aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-03 19:47:00 +0000
committerGitHub <[email protected]>2020-12-03 19:47:00 +0000
commitb988c6f84e06bdc5562c70f28586b9eeaae3a39c (patch)
treed001026a17e5099d8df5259ded74b6ad4b2ce1fa /crates/ide/src
parent070ecef24912910417ca723cb2f1d1b350cc79d8 (diff)
parent6e1c87eb92f129cc6f5977b8b0f5893de4ae8d78 (diff)
Merge #6715
6715: Don't diagnose `#[cfg]` in macros r=jonas-schievink a=jonas-schievink Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6363 bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/ide/src')
-rw-r--r--crates/ide/src/diagnostics.rs5
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())