Open
Description
Summary
filter_map_bool_then
wrongly showed the macro definition instead of its call site in suggestions
Reproducer
I tried this code:
tokenize_with_text(&snippet)
.filter_map(|(t, s, inner)| {
matches!(t, TokenKind::Ident if s == keyword).then(|| {
span.split_at(inner.start as u32)
.1
.split_at((inner.end - inner.start) as u32)
.0
})
})
I expected to see this happen:
.filter(|&(t, s, inner)| matches!(t, TokenKind::Ident if s == keyword))
.map(..)
Instead, this happened:
.filter(|&(t, s, inner)| match $expression {
$pattern $(if $guard)? => true,
_ => false
}).map(..)
Version
Additional Labels
@rustbot label + I-suggestion-causes-error