Rollup merge of #122435 - jieyouxu:unused_qualifications_global_paths, r=petrochenkov
Don't trigger `unused_qualifications` on global paths Fixes #122374.
This commit is contained in:
commit
489c2e9918
5 changed files with 30 additions and 25 deletions
|
@ -4665,6 +4665,13 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
|
|||
}
|
||||
|
||||
fn lint_unused_qualifications(&mut self, path: &[Segment], ns: Namespace, finalize: Finalize) {
|
||||
// Don't lint on global paths because the user explicitly wrote out the full path.
|
||||
if let Some(seg) = path.first()
|
||||
&& seg.ident.name == kw::PathRoot
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if path.iter().any(|seg| seg.ident.span.from_expansion()) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue