diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ide/src/diagnostics.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs index 9d3d88289..c8453edb3 100644 --- a/crates/ide/src/diagnostics.rs +++ b/crates/ide/src/diagnostics.rs | |||
@@ -135,6 +135,11 @@ pub(crate) fn diagnostics( | |||
135 | res.borrow_mut().push(warning_with_fix(d, &sema)); | 135 | res.borrow_mut().push(warning_with_fix(d, &sema)); |
136 | }) | 136 | }) |
137 | .on::<hir::diagnostics::InactiveCode, _>(|d| { | 137 | .on::<hir::diagnostics::InactiveCode, _>(|d| { |
138 | // If there's inactive code somewhere in a macro, don't propagate to the call-site. | ||
139 | if d.display_source().file_id.expansion_info(db).is_some() { | ||
140 | return; | ||
141 | } | ||
142 | |||
138 | // Override severity and mark as unused. | 143 | // Override severity and mark as unused. |
139 | res.borrow_mut().push( | 144 | res.borrow_mut().push( |
140 | Diagnostic::hint(sema.diagnostics_display_range(d).range, d.message()) | 145 | Diagnostic::hint(sema.diagnostics_display_range(d).range, d.message()) |