mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
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 <jonasschievink@gmail.com>
This commit is contained in:
commit
b988c6f84e
@ -135,6 +135,11 @@ pub(crate) fn diagnostics(
|
|||||||
res.borrow_mut().push(warning_with_fix(d, &sema));
|
res.borrow_mut().push(warning_with_fix(d, &sema));
|
||||||
})
|
})
|
||||||
.on::<hir::diagnostics::InactiveCode, _>(|d| {
|
.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() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Override severity and mark as unused.
|
// Override severity and mark as unused.
|
||||||
res.borrow_mut().push(
|
res.borrow_mut().push(
|
||||||
Diagnostic::hint(sema.diagnostics_display_range(d).range, d.message())
|
Diagnostic::hint(sema.diagnostics_display_range(d).range, d.message())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user