diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-11-17 22:33:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-17 22:33:19 +0100 |
| commit | ed97f245f1a15f0ba22a622fb693ac8bdbdbed0c (patch) | |
| tree | a9a34f97b542b69da55fd6243c21fd3e18f1a08f /compiler/rustc_const_eval/src/transform | |
| parent | 1c52c247f98fd66b11be0179b1e3f80f05b5ddfe (diff) | |
| parent | 4f11f3b2571c895c08757aa91af57fc1091e45ef (diff) | |
| download | rust-ed97f245f1a15f0ba22a622fb693ac8bdbdbed0c.tar.gz rust-ed97f245f1a15f0ba22a622fb693ac8bdbdbed0c.zip | |
Rollup merge of #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 https://github.com/rust-lang/compiler-team/issues/531 (as it makes it easier to accept both goals and clauses where right now it only accepts predicates).
Diffstat (limited to 'compiler/rustc_const_eval/src/transform')
3 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/check.rs b/compiler/rustc_const_eval/src/transform/check_consts/check.rs index 5a8b3e30b9f..36956f5dd6d 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/check.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/check.rs @@ -732,7 +732,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> { polarity: ty::ImplPolarity::Positive, }); let obligation = - Obligation::new(ObligationCause::dummy(), param_env, poly_trait_pred); + Obligation::new(tcx, ObligationCause::dummy(), param_env, poly_trait_pred); let implsrc = { let infcx = tcx.infer_ctxt().build(); @@ -816,6 +816,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> { if !nonconst_call_permission { let obligation = Obligation::new( + tcx, ObligationCause::dummy_with_span(*fn_span), param_env, tcx.mk_predicate( diff --git a/compiler/rustc_const_eval/src/transform/check_consts/ops.rs b/compiler/rustc_const_eval/src/transform/check_consts/ops.rs index b28d7019491..2d4afd0dc35 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/ops.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/ops.rs @@ -147,6 +147,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx> { } Adt(..) => { let obligation = Obligation::new( + tcx, ObligationCause::dummy(), param_env, Binder::dummy(TraitPredicate { diff --git a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs index 8a920fbfd51..6fd12985170 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs @@ -156,6 +156,7 @@ impl Qualif for NeedsNonConstDrop { let destruct = cx.tcx.require_lang_item(LangItem::Destruct, None); let obligation = Obligation::new( + cx.tcx, ObligationCause::dummy(), cx.param_env, ty::Binder::dummy(ty::TraitPredicate { |
