rust/compiler/rustc_next_trait_solver/src/solve
Matthias Krüger 9108907a18
Rollup merge of #142806 - compiler-errors:norm-ct-has-ty, r=lcnr,BoxyUwU
Normalize before computing ConstArgHasType goal in new solver

This is a fix for rust-lang/rust#139905. See the description I left in the test.

I chose to fix this by normalizing the type before matching on its `.kind()` in `compute_const_arg_has_type_goal` (since it feels somewhat consistent with how we normalize types before assembling their candidates, for example); however, there are several other solutions that come to mind for fixing this ICE:
1. (this solution)
2. Giving `ConstKind::Error` a proper type, like `ConstKind::Value`, so that consts don't go from failing to passing `ConstArgHasType` goals after normalization (i.e. `UNEVALUATED` would normalize into a `ConstKind::Error(_, bool)` type rather than losing its type altogether).
3. Just suppressing the errors and accepting the fact that goals can go from fail->pass after normalization.

Thoughts? Happy to discuss this fix further.

r? `@BoxyUwU`
2025-06-27 22:13:03 +02:00
..
assembly Rollup merge of #139858 - oli-obk:new-const-traits-syntax, r=fee1-dead 2025-06-27 22:13:00 +02:00
eval_ctxt Auto merge of #142774 - lcnr:search_graph-2, r=oli-obk 2025-06-26 17:04:47 +00:00
inspect inspect: merge [Canonical]GoalEvaluation 2025-06-23 11:50:36 +02:00
normalizes_to trait_sel: {Meta,Pointee}Sized on ?Sized types 2025-06-16 15:00:22 +00:00
alias_relate.rs norm nested aliases before evaluating the parent goal 2025-04-24 18:41:43 +00:00
effect_goals.rs Change const trait bound syntax from ~const to [const] 2025-06-26 13:46:45 +00:00
mod.rs Rollup merge of #142806 - compiler-errors:norm-ct-has-ty, r=lcnr,BoxyUwU 2025-06-27 22:13:03 +02:00
project_goals.rs change definitely non-productive cycles to error 2025-03-05 10:06:43 +01:00
search_graph.rs evaluate_goal: avoid unnecessary step 2025-06-23 11:50:36 +02:00
trait_goals.rs Apply impl_super_outlives optimization to new trait solver 2025-06-19 21:03:50 +00:00