about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/bounds.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_hir_analysis/src/bounds.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/bounds.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_hir_analysis/src/bounds.rs b/compiler/rustc_hir_analysis/src/bounds.rs
index 5562b81871f..38ecd7dd082 100644
--- a/compiler/rustc_hir_analysis/src/bounds.rs
+++ b/compiler/rustc_hir_analysis/src/bounds.rs
@@ -2,7 +2,7 @@
 //! [`rustc_middle::ty`] form.
 
 use rustc_hir::LangItem;
-use rustc_middle::ty::{self, ToPredicate, Ty, TyCtxt};
+use rustc_middle::ty::{self, Ty, TyCtxt, Upcast};
 use rustc_span::Span;
 
 /// Collects together a list of type bounds. These lists of bounds occur in many places
@@ -34,7 +34,7 @@ impl<'tcx> Bounds<'tcx> {
         span: Span,
     ) {
         self.clauses
-            .push((region.map_bound(|p| ty::ClauseKind::TypeOutlives(p)).to_predicate(tcx), span));
+            .push((region.map_bound(|p| ty::ClauseKind::TypeOutlives(p)).upcast(tcx), span));
     }
 
     pub fn push_trait_bound(
@@ -49,7 +49,7 @@ impl<'tcx> Bounds<'tcx> {
                 .map_bound(|trait_ref| {
                     ty::ClauseKind::Trait(ty::TraitPredicate { trait_ref, polarity })
                 })
-                .to_predicate(tcx),
+                .upcast(tcx),
             span,
         );
         // FIXME(-Znext-solver): We can likely remove this hack once the new trait solver lands.
@@ -67,7 +67,7 @@ impl<'tcx> Bounds<'tcx> {
         span: Span,
     ) {
         self.clauses.push((
-            projection.map_bound(|proj| ty::ClauseKind::Projection(proj)).to_predicate(tcx),
+            projection.map_bound(|proj| ty::ClauseKind::Projection(proj)).upcast(tcx),
             span,
         ));
     }
@@ -76,7 +76,7 @@ impl<'tcx> Bounds<'tcx> {
         let sized_def_id = tcx.require_lang_item(LangItem::Sized, Some(span));
         let trait_ref = ty::TraitRef::new(tcx, sized_def_id, [ty]);
         // Preferable to put this obligation first, since we report better errors for sized ambiguity.
-        self.clauses.insert(0, (trait_ref.to_predicate(tcx), span));
+        self.clauses.insert(0, (trait_ref.upcast(tcx), span));
     }
 
     pub fn clauses(&self) -> impl Iterator<Item = (ty::Clause<'tcx>, Span)> + '_ {