Skip to content

Commit

Permalink
Ignore paths from expansion in unused_qualifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexendoo committed Mar 20, 2024
1 parent c86f3ac commit a845246
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_resolve/src/late.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions tests/ui/lint/lint-qualification.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ fn main() {
foo::bar();
foo::$b(); // issue #96698
$a::bar();
$a::$b();
} }
m!(foo, bar);
}
Expand Down
1 change: 1 addition & 0 deletions tests/ui/lint/lint-qualification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ fn main() {
foo::bar();
foo::$b(); // issue #96698
$a::bar();
$a::$b();
} }
m!(foo, bar);
}
Expand Down

0 comments on commit a845246

Please sign in to comment.