summaryrefslogtreecommitdiff
path: root/compiler/rustc_resolve/src/late.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_resolve/src/late.rs')
-rw-r--r--compiler/rustc_resolve/src/late.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs
index 837c069b599..c661be3587e 100644
--- a/compiler/rustc_resolve/src/late.rs
+++ b/compiler/rustc_resolve/src/late.rs
@@ -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;
}