Skip to content

Commit c3eaa13

Browse files
committed
assert we never incorrectly canonicalize envs
1 parent 23af183 commit c3eaa13

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

compiler/rustc_next_trait_solver/src/canonicalizer.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,13 @@ impl<D: SolverDelegate<Interner = I>, I: Interner> TypeFolder<I> for Canonicaliz
618618
}
619619

620620
fn fold_clauses(&mut self, c: I::Clauses) -> I::Clauses {
621+
match self.canonicalize_mode {
622+
CanonicalizeMode::Input { keep_static: true }
623+
| CanonicalizeMode::Response { max_input_universe: _ } => {}
624+
CanonicalizeMode::Input { keep_static: false } => {
625+
panic!("erasing 'static in env")
626+
}
627+
}
621628
if c.flags().intersects(NEEDS_CANONICAL) { c.super_fold_with(self) } else { c }
622629
}
623630
}

0 commit comments

Comments
 (0)