Add diagnostic for filter_map followed by next

This commit is contained in:
Phil Ellison 2020-12-28 13:41:15 +00:00
parent eab5db20ed
commit 1316422a7c
5 changed files with 150 additions and 15 deletions

View file

@ -136,6 +136,9 @@ pub(crate) fn diagnostics(
.on::<hir::diagnostics::IncorrectCase, _>(|d| {
res.borrow_mut().push(warning_with_fix(d, &sema));
})
.on::<hir::diagnostics::ReplaceFilterMapNextWithFindMap, _>(|d| {
res.borrow_mut().push(warning_with_fix(d, &sema));
})
.on::<hir::diagnostics::InactiveCode, _>(|d| {
// If there's inactive code somewhere in a macro, don't propagate to the call-site.
if d.display_source().file_id.expansion_info(db).is_some() {