Skip to content

Commit 8ad6af7

Browse files
committed
Ignore paths from expansion in unused_qualifications
1 parent 3521a2f commit 8ad6af7

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

compiler/rustc_resolve/src/late.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -4636,7 +4636,9 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
46364636
}
46374637

46384638
fn lint_unused_qualifications(&mut self, path: &[Segment], ns: Namespace, finalize: Finalize) {
4639-
if path.iter().any(|seg| seg.ident.span.from_expansion()) {
4639+
if finalize.path_span.from_expansion()
4640+
|| path.iter().any(|seg| seg.ident.span.from_expansion())
4641+
{
46404642
return;
46414643
}
46424644

tests/ui/lint/lint-qualification.fixed

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ fn main() {
3333
foo::bar();
3434
foo::$b(); // issue #96698
3535
$a::bar();
36+
$a::$b();
3637
} }
3738
m!(foo, bar);
3839
}

tests/ui/lint/lint-qualification.rs

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ fn main() {
3333
foo::bar();
3434
foo::$b(); // issue #96698
3535
$a::bar();
36+
$a::$b();
3637
} }
3738
m!(foo, bar);
3839
}

0 commit comments

Comments
 (0)