rust-clippy
rust-clippy copied to clipboard
`filter_map_bool_then` should not show the macro definition in suggestions
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
Error: Parsing relabel command in comment failed: ...' label +' | error: empty label at >| ' I-suggest'...
Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.
Looks like it can be fixed very quickly. I will take it myself then. @rustbot claim