Skip to content

Commit a845246

Browse files
committed
Ignore paths from expansion in unused_qualifications
1 parent c86f3ac commit a845246

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
@@ -4672,7 +4672,9 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
46724672
return;
46734673
}
46744674

4675-
if path.iter().any(|seg| seg.ident.span.from_expansion()) {
4675+
if finalize.path_span.from_expansion()
4676+
|| path.iter().any(|seg| seg.ident.span.from_expansion())
4677+
{
46764678
return;
46774679
}
46784680

tests/ui/lint/lint-qualification.fixed

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ fn main() {
3535
foo::bar();
3636
foo::$b(); // issue #96698
3737
$a::bar();
38+
$a::$b();
3839
} }
3940
m!(foo, bar);
4041
}

tests/ui/lint/lint-qualification.rs

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ fn main() {
3535
foo::bar();
3636
foo::$b(); // issue #96698
3737
$a::bar();
38+
$a::$b();
3839
} }
3940
m!(foo, bar);
4041
}

0 commit comments

Comments
 (0)