diff options
| author | lcnr <rust@lcnr.de> | 2025-02-18 10:29:16 +0100 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2025-02-18 10:30:37 +0100 |
| commit | f910684616f357a8084151a162ed3c3fe0e512e6 (patch) | |
| tree | 92d469feb57b50b15312abdce57b54bd2c399eb8 /compiler/rustc_next_trait_solver/src | |
| parent | 273465e1f2932a30a5b56ac95859cdc86f3f33fa (diff) | |
| download | rust-f910684616f357a8084151a162ed3c3fe0e512e6.tar.gz rust-f910684616f357a8084151a162ed3c3fe0e512e6.zip | |
don't ICE for alias-relate goals with error term
Diffstat (limited to 'compiler/rustc_next_trait_solver/src')
| -rw-r--r-- | compiler/rustc_next_trait_solver/src/solve/alias_relate.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/rustc_next_trait_solver/src/solve/alias_relate.rs b/compiler/rustc_next_trait_solver/src/solve/alias_relate.rs index d8c1dc8b4e9..0fc313e33b3 100644 --- a/compiler/rustc_next_trait_solver/src/solve/alias_relate.rs +++ b/compiler/rustc_next_trait_solver/src/solve/alias_relate.rs @@ -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() { |
