Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/nameres.rs')
| -rw-r--r-- | crates/hir-def/src/nameres.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/crates/hir-def/src/nameres.rs b/crates/hir-def/src/nameres.rs index f44187ec59..b2c50f35be 100644 --- a/crates/hir-def/src/nameres.rs +++ b/crates/hir-def/src/nameres.rs @@ -842,9 +842,14 @@ impl MacroSubNs { /// We ignore resolutions from one sub-namespace when searching names in scope for another. /// /// [rustc]: https://github.com/rust-lang/rust/blob/1.69.0/compiler/rustc_resolve/src/macros.rs#L75 -fn sub_namespace_match(candidate: Option<MacroSubNs>, expected: Option<MacroSubNs>) -> bool { - match (candidate, expected) { - (Some(candidate), Some(expected)) => candidate == expected, - _ => true, +fn sub_namespace_match( + db: &dyn DefDatabase, + macro_id: MacroId, + expected: Option<MacroSubNs>, +) -> bool { + let candidate = MacroSubNs::from_id(db, macro_id); + match expected { + Some(expected) => candidate == expected, + None => true, } } |