Skip to content

Commit 31adfd7

Browse files
authored
Rollup merge of #122545 - Alexendoo:unused-qualifications, r=petrochenkov
Ignore paths from expansion in `unused_qualifications` If any of the path segments are from an expansion the lint is skipped currently, but a path from an expansion where all of the segments are passed in would not be. Doesn't seem that likely to occur but it could happen
2 parents 1388d7a + a845246 commit 31adfd7

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)