diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index c661be3587e92..fc0374048294f 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -4672,7 +4672,9 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> { return; } - if path.iter().any(|seg| seg.ident.span.from_expansion()) { + if finalize.path_span.from_expansion() + || path.iter().any(|seg| seg.ident.span.from_expansion()) + { return; } diff --git a/tests/ui/lint/lint-qualification.fixed b/tests/ui/lint/lint-qualification.fixed index 2070bbcef5269..7c8fd5236e608 100644 --- a/tests/ui/lint/lint-qualification.fixed +++ b/tests/ui/lint/lint-qualification.fixed @@ -35,6 +35,7 @@ fn main() { foo::bar(); foo::$b(); // issue #96698 $a::bar(); + $a::$b(); } } m!(foo, bar); } diff --git a/tests/ui/lint/lint-qualification.rs b/tests/ui/lint/lint-qualification.rs index 41b7e17c6ed45..009b3080d5c79 100644 --- a/tests/ui/lint/lint-qualification.rs +++ b/tests/ui/lint/lint-qualification.rs @@ -35,6 +35,7 @@ fn main() { foo::bar(); foo::$b(); // issue #96698 $a::bar(); + $a::$b(); } } m!(foo, bar); }