]> git.lizzy.rs Git - rust.git/commitdiff
Fix panic with outlives in existential type
authorDan Robertson <dan@dlrobertson.com>
Fri, 30 Nov 2018 02:04:10 +0000 (02:04 +0000)
committerDan Robertson <dan@dlrobertson.com>
Fri, 30 Nov 2018 02:04:10 +0000 (02:04 +0000)
Don't panic in determining the privacy of a type if a lifetime outlives
generic exists in an existential type.

src/librustc_privacy/lib.rs

index fbd6f6edd31c5af4bc6b1589e6e3a7c79b42fdd1..6d9abbf5af2ac1ca564203ed7b8f47ae49be6661 100644 (file)
@@ -969,7 +969,7 @@ fn visit_ty(&mut self, ty: Ty<'tcx>) -> bool {
                             Some(poly_projection_predicate.skip_binder()
                                                           .projection_ty.trait_ref(self.tcx))
                         }
-                        ty::Predicate::TypeOutlives(..) => None,
+                        ty::Predicate::TypeOutlives(..) | ty::Predicate::RegionOutlives(..) => None,
                         _ => bug!("unexpected predicate: {:?}", predicate),
                     };
                     if let Some(trait_ref) = trait_ref {