1
Fork 0

don't ICE for alias-relate goals with error term

This commit is contained in:
lcnr 2025-02-18 10:29:16 +01:00
parent 273465e1f2
commit f910684616
2 changed files with 26 additions and 1 deletions

View file

@ -34,7 +34,17 @@ where
) -> QueryResult<I> {
let cx = self.cx();
let Goal { param_env, predicate: (lhs, rhs, direction) } = goal;
debug_assert!(lhs.to_alias_term().is_some() || rhs.to_alias_term().is_some());
// Check that the alias-relate goal is reasonable. Writeback for
// `coroutine_stalled_predicates` can replace alias terms with
// `{type error}` if the alias still contains infer vars, so we also
// accept alias-relate goals where one of the terms is an error.
debug_assert!(
lhs.to_alias_term().is_some()
|| rhs.to_alias_term().is_some()
|| lhs.is_error()
|| rhs.is_error()
);
// Structurally normalize the lhs.
let lhs = if let Some(alias) = lhs.to_alias_term() {