Fix detection of macro file in inactive-code diag
This commit is contained in:
parent
1b02cafa43
commit
260936d0b7
@ -173,6 +173,10 @@ pub fn is_include_macro(&self, db: &dyn db::AstDatabase) -> bool {
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_macro(self) -> bool {
|
||||
matches!(self.0, HirFileIdRepr::MacroFile(_))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
|
@ -11,7 +11,7 @@ pub(crate) fn inactive_code(
|
||||
d: &hir::InactiveCode,
|
||||
) -> Option<Diagnostic> {
|
||||
// If there's inactive code somewhere in a macro, don't propagate to the call-site.
|
||||
if d.node.file_id.expansion_info(ctx.sema.db).is_some() {
|
||||
if d.node.file_id.is_macro() {
|
||||
return None;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user