Skip to content

Commit 0830ce0

Browse files
lcnrcompiler-errors
authored andcommitted
assert we never incorrectly canonicalize envs
1 parent c56efae commit 0830ce0

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

576576
fn fold_clauses(&mut self, c: I::Clauses) -> I::Clauses {
577+
match self.canonicalize_mode {
578+
CanonicalizeMode::Input { keep_static: true }
579+
| CanonicalizeMode::Response { max_input_universe: _ } => {}
580+
CanonicalizeMode::Input { keep_static: false } => {
581+
panic!("erasing 'static in env")
582+
}
583+
}
577584
if c.flags().intersects(NEEDS_CANONICAL) { c.super_fold_with(self) } else { c }
578585
}
579586
}

0 commit comments

Comments
 (0)