Don't trigger unused_qualifications
on global paths
# Conflicts: # tests/ui/lint/lint-qualification.stderr
This commit is contained in:
parent
accc516128
commit
85bad8d1bf
5 changed files with 30 additions and 25 deletions
|
@ -4645,6 +4645,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