]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/collect.rs
directly contain `PredicateAtom` in `PredicateKind::ForAll`
[rust.git] / src / librustc_typeck / collect.rs
index d906c5c05c019eadef5e1e8f87c2ceaebd8d0cb1..a733ad4fccdc6b114cf57355ffe541d04ad12476 100644 (file)
@@ -1961,7 +1961,6 @@ fn extend<I: IntoIterator<Item = (ty::Predicate<'tcx>, Span)>>(&mut self, iter:
                             let region = AstConv::ast_region_to_region(&icx, lifetime, None);
                             predicates.push((
                                 ty::PredicateAtom::TypeOutlives(ty::OutlivesPredicate(ty, region))
-                                    .to_predicate(tcx)
                                     .potentially_quantified(tcx, ty::PredicateKind::ForAll),
                                 lifetime.span,
                             ))
@@ -1979,8 +1978,7 @@ fn extend<I: IntoIterator<Item = (ty::Predicate<'tcx>, Span)>>(&mut self, iter:
                         }
                         _ => bug!(),
                     };
-                    let pred = ty::PredicateAtom::RegionOutlives(ty::OutlivesPredicate(r1, r2))
-                        .to_predicate(icx.tcx);
+                    let pred = ty::PredicateAtom::RegionOutlives(ty::OutlivesPredicate(r1, r2));
 
                     (pred.potentially_quantified(icx.tcx, ty::PredicateKind::ForAll), span)
                 }))
@@ -2111,7 +2109,6 @@ fn predicates_from_bound<'tcx>(
         hir::GenericBound::Outlives(ref lifetime) => {
             let region = astconv.ast_region_to_region(lifetime, None);
             let pred = ty::PredicateAtom::TypeOutlives(ty::OutlivesPredicate(param_ty, region))
-                .to_predicate(astconv.tcx())
                 .potentially_quantified(astconv.tcx(), ty::PredicateKind::ForAll);
             vec![(pred, lifetime.span)]
         }