Skip to content

Commit 32b1d1f

Browse files
authored
Merge pull request #3270 from rust-lang-nursery/rustup
Rustup for #54741
2 parents cbde820 + 53d41e5 commit 32b1d1f

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

clippy_lints/src/lifetimes.rs

+11-14
Original file line numberDiff line numberDiff line change
@@ -344,23 +344,20 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
344344
self.record(&None);
345345
},
346346
TyKind::Path(ref path) => {
347-
if let QPath::Resolved(_, ref path) = *path {
348-
if let Def::Existential(def_id) = path.def {
349-
let node_id = self.cx.tcx.hir.as_local_node_id(def_id).unwrap();
350-
if let ItemKind::Existential(ref exist_ty) = self.cx.tcx.hir.expect_item(node_id).node {
351-
for bound in &exist_ty.bounds {
352-
if let GenericBound::Outlives(_) = *bound {
353-
self.record(&None);
354-
}
355-
}
356-
} else {
357-
unreachable!()
347+
348+
self.collect_anonymous_lifetimes(path, ty);
349+
}
350+
TyKind::Def(item, _) => {
351+
if let ItemKind::Existential(ref exist_ty) = self.cx.tcx.hir.expect_item(item.id).node {
352+
for bound in &exist_ty.bounds {
353+
if let GenericBound::Outlives(_) = *bound {
354+
self.record(&None);
358355
}
359-
walk_ty(self, ty);
360-
return;
361356
}
357+
} else {
358+
unreachable!()
362359
}
363-
self.collect_anonymous_lifetimes(path, ty);
360+
walk_ty(self, ty);
364361
}
365362
TyKind::TraitObject(ref bounds, ref lt) => {
366363
if !lt.is_elided() {

0 commit comments

Comments
 (0)