Skip to content

Commit f7535e7

Browse files
authored
Rollup merge of rust-lang#104483 - oli-obk:santa-clauses-make-goals, r=compiler-errors
Convert predicates into Predicate in the Obligation constructor instead of having almost all callers do that. This reduces a bit of boilerplate, and also paves the way for my work towards rust-lang/compiler-team#531 (as it makes it easier to accept both goals and clauses where right now it only accepts predicates).
2 parents 11d632f + e5352c7 commit f7535e7

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

clippy_lints/src/dereference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ fn needless_borrow_impl_arg_position<'tcx>(
11561156
}
11571157

11581158
let predicate = EarlyBinder(predicate).subst(cx.tcx, &substs_with_referent_ty);
1159-
let obligation = Obligation::new(ObligationCause::dummy(), cx.param_env, predicate);
1159+
let obligation = Obligation::new(cx.tcx, ObligationCause::dummy(), cx.param_env, predicate);
11601160
let infcx = cx.tcx.infer_ctxt().build();
11611161
infcx.predicate_must_hold_modulo_regions(&obligation)
11621162
})

clippy_lints/src/methods/unnecessary_to_owned.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ fn can_change_type<'a>(cx: &LateContext<'a>, mut expr: &'a Expr<'a>, mut ty: Ty<
419419

420420
if trait_predicates.any(|predicate| {
421421
let predicate = EarlyBinder(predicate).subst(cx.tcx, new_subst);
422-
let obligation = Obligation::new(ObligationCause::dummy(), cx.param_env, predicate);
422+
let obligation = Obligation::new(cx.tcx, ObligationCause::dummy(), cx.param_env, predicate);
423423
!cx.tcx.infer_ctxt().build().predicate_must_hold_modulo_regions(&obligation)
424424
}) {
425425
return false;

clippy_lints/src/ptr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ fn matches_preds<'tcx>(
695695
.type_implements_trait(p.def_id, ty, p.substs, cx.param_env)
696696
.must_apply_modulo_regions(),
697697
ExistentialPredicate::Projection(p) => infcx.predicate_must_hold_modulo_regions(&Obligation::new(
698+
cx.tcx,
698699
ObligationCause::dummy(),
699700
cx.param_env,
700701
cx.tcx.mk_predicate(Binder::bind_with_vars(

0 commit comments

Comments
 (0)