diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 9c5fb4ce73450..fc00050f40518 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -637,7 +637,7 @@ impl EmbargoVisitor<'tcx> { &mut self, segments: &[hir::PathSegment<'_>], ) { - if let Some([module, segment]) = segments.rchunks_exact(2).next() { + if let [.., module, segment] = segments { if let Some(item) = module .res .and_then(|res| res.mod_def_id())