Skip to content

Commit

Permalink
Merge pull request rust-lang#3270 from rust-lang-nursery/rustup
Browse files Browse the repository at this point in the history
Rustup for rust-lang#54741
  • Loading branch information
Manishearth authored Oct 6, 2018
2 parents cbde820 + 53d41e5 commit 32b1d1f
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions clippy_lints/src/lifetimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,23 +344,20 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
self.record(&None);
},
TyKind::Path(ref path) => {
if let QPath::Resolved(_, ref path) = *path {
if let Def::Existential(def_id) = path.def {
let node_id = self.cx.tcx.hir.as_local_node_id(def_id).unwrap();
if let ItemKind::Existential(ref exist_ty) = self.cx.tcx.hir.expect_item(node_id).node {
for bound in &exist_ty.bounds {
if let GenericBound::Outlives(_) = *bound {
self.record(&None);
}
}
} else {
unreachable!()

self.collect_anonymous_lifetimes(path, ty);
}
TyKind::Def(item, _) => {
if let ItemKind::Existential(ref exist_ty) = self.cx.tcx.hir.expect_item(item.id).node {
for bound in &exist_ty.bounds {
if let GenericBound::Outlives(_) = *bound {
self.record(&None);
}
walk_ty(self, ty);
return;
}
} else {
unreachable!()
}
self.collect_anonymous_lifetimes(path, ty);
walk_ty(self, ty);
}
TyKind::TraitObject(ref bounds, ref lt) => {
if !lt.is_elided() {
Expand Down

0 comments on commit 32b1d1f

Please sign in to comment.