Skip to content

Commit 20a2cd8

Browse files
committed
assert we never incorrectly canonicalize envs
1 parent 9127a13 commit 20a2cd8

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
@@ -625,6 +625,13 @@ impl<D: SolverDelegate<Interner = I>, I: Interner> TypeFolder<I> for Canonicaliz
625625
}
626626

627627
fn fold_clauses(&mut self, c: I::Clauses) -> I::Clauses {
628+
match self.canonicalize_mode {
629+
CanonicalizeMode::Input { keep_static: true }
630+
| CanonicalizeMode::Response { max_input_universe: _ } => {}
631+
CanonicalizeMode::Input { keep_static: false } => {
632+
panic!("erasing 'static in env")
633+
}
634+
}
628635
if c.flags().intersects(NEEDS_CANONICAL) { c.super_fold_with(self) } else { c }
629636
}
630637
}

0 commit comments

Comments
 (0)