diff --git a/compiler/rustc_hir_typeck/src/method/probe.rs b/compiler/rustc_hir_typeck/src/method/probe.rs index 7ec0bdbef99d7..fc652490a40aa 100644 --- a/compiler/rustc_hir_typeck/src/method/probe.rs +++ b/compiler/rustc_hir_typeck/src/method/probe.rs @@ -1496,7 +1496,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> { } } - trait_predicate = Some(ty::Binder::dummy(trait_ref).upcast(self.tcx)); + trait_predicate = Some(trait_ref.upcast(self.tcx)); } ObjectCandidate(poly_trait_ref) | WhereClauseCandidate(poly_trait_ref) => { let trait_ref = self.instantiate_binder_with_fresh_vars( diff --git a/compiler/rustc_infer/src/traits/engine.rs b/compiler/rustc_infer/src/traits/engine.rs index cf523f056a326..e27e6a0a4a151 100644 --- a/compiler/rustc_infer/src/traits/engine.rs +++ b/compiler/rustc_infer/src/traits/engine.rs @@ -26,7 +26,7 @@ pub trait TraitEngine<'tcx>: 'tcx { cause, recursion_depth: 0, param_env, - predicate: ty::Binder::dummy(trait_ref).upcast(infcx.tcx), + predicate: trait_ref.upcast(infcx.tcx), }, ); } diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 9c36e22aa298b..4748b3d08dccd 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -734,7 +734,7 @@ fn type_implements_negative_copy_modulo_regions<'tcx>( cause: traits::ObligationCause::dummy(), param_env, recursion_depth: 0, - predicate: ty::Binder::dummy(pred).upcast(tcx), + predicate: pred.upcast(tcx), }; tcx.infer_ctxt().build().predicate_must_hold_modulo_regions(&obligation) diff --git a/compiler/rustc_trait_selection/src/infer.rs b/compiler/rustc_trait_selection/src/infer.rs index 6797be5cdd08e..fc852293dff0e 100644 --- a/compiler/rustc_trait_selection/src/infer.rs +++ b/compiler/rustc_trait_selection/src/infer.rs @@ -63,7 +63,7 @@ impl<'tcx> InferCtxt<'tcx> { cause: traits::ObligationCause::dummy(), param_env, recursion_depth: 0, - predicate: ty::Binder::dummy(trait_ref).upcast(self.tcx), + predicate: trait_ref.upcast(self.tcx), }; self.evaluate_obligation(&obligation).unwrap_or(traits::EvaluationResult::EvaluatedToErr) } diff --git a/compiler/rustc_trait_selection/src/traits/engine.rs b/compiler/rustc_trait_selection/src/traits/engine.rs index ad56b8f329b1f..4684c7171d829 100644 --- a/compiler/rustc_trait_selection/src/traits/engine.rs +++ b/compiler/rustc_trait_selection/src/traits/engine.rs @@ -96,7 +96,7 @@ impl<'a, 'tcx> ObligationCtxt<'a, 'tcx> { cause, recursion_depth: 0, param_env, - predicate: ty::Binder::dummy(trait_ref).upcast(tcx), + predicate: trait_ref.upcast(tcx), }); } diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs index b38d266271a41..204bb487c8608 100644 --- a/compiler/rustc_trait_selection/src/traits/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/mod.rs @@ -457,7 +457,7 @@ fn instantiate_and_check_impossible_predicates<'tcx>( // associated items. if let Some(trait_def_id) = tcx.trait_of_item(key.0) { let trait_ref = ty::TraitRef::from_method(tcx, trait_def_id, key.1); - predicates.push(ty::Binder::dummy(trait_ref).upcast(tcx)); + predicates.push(trait_ref.upcast(tcx)); } predicates.retain(|predicate| !predicate.has_param()); diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index 27bdc1da7dffb..65048ffdfba53 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -1259,7 +1259,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { // being cast to `Foo + 'a` outlives `'a`: let outlives = ty::OutlivesPredicate(source, r); nested.push(predicate_to_obligation( - ty::Binder::dummy(ty::ClauseKind::TypeOutlives(outlives)).upcast(tcx), + ty::ClauseKind::TypeOutlives(outlives).upcast(tcx), )); ImplSource::Builtin(BuiltinImplSource::Misc, nested) diff --git a/src/librustdoc/clean/blanket_impl.rs b/src/librustdoc/clean/blanket_impl.rs index 223c3831d5a32..8310295d99759 100644 --- a/src/librustdoc/clean/blanket_impl.rs +++ b/src/librustdoc/clean/blanket_impl.rs @@ -64,7 +64,7 @@ pub(crate) fn synthesize_blanket_impls( .instantiate(tcx, impl_args) .predicates .into_iter() - .chain(Some(ty::Binder::dummy(impl_trait_ref).upcast(tcx))); + .chain(Some(impl_trait_ref.upcast(tcx))); for predicate in predicates { let obligation = traits::Obligation::new( tcx, diff --git a/src/tools/clippy/clippy_utils/src/ty.rs b/src/tools/clippy/clippy_utils/src/ty.rs index b604f3ff65fc6..50c387bd59ec5 100644 --- a/src/tools/clippy/clippy_utils/src/ty.rs +++ b/src/tools/clippy/clippy_utils/src/ty.rs @@ -311,7 +311,7 @@ pub fn implements_trait_with_env_from_iter<'tcx>( cause: ObligationCause::dummy(), param_env, recursion_depth: 0, - predicate: Binder::dummy(trait_ref).upcast(tcx), + predicate: trait_ref.upcast(tcx), }; infcx .evaluate_obligation(&obligation)