Skip to content

Commit

Permalink
don't fold ParamEnv in register_predicate_obligation
Browse files Browse the repository at this point in the history
  • Loading branch information
aliemjay committed Dec 17, 2023
1 parent 604f185 commit e0df93b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/rustc_trait_selection/src/traits/fulfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,13 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentContext<'tcx> {
fn register_predicate_obligation(
&mut self,
infcx: &InferCtxt<'tcx>,
obligation: PredicateObligation<'tcx>,
mut obligation: PredicateObligation<'tcx>,
) {
assert_eq!(self.usable_in_snapshot, infcx.num_open_snapshots());
// this helps to reduce duplicate errors, as well as making
// debug output much nicer to read and so on.
let obligation = infcx.resolve_vars_if_possible(obligation);
debug_assert!(!obligation.param_env.has_non_region_infer());
obligation.predicate = infcx.resolve_vars_if_possible(obligation.predicate);

debug!(?obligation, "register_predicate_obligation");

Expand Down

0 comments on commit e0df93b

Please sign in to comment.