Skip to content

Commit

Permalink
Remove trivial Binder::dummy calls
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed May 16, 2024
1 parent 6d81736 commit 7b3d6da
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/method/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/traits/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
);
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/traits/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
});
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/clean/blanket_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_utils/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7b3d6da

Please sign in to comment.