fix ICE const parameters cannot be generic in generic_const_exprs#108172
fix ICE const parameters cannot be generic in generic_const_exprs#108172kylematsuda wants to merge 1 commit intorust-lang:masterfrom
const parameters cannot be generic in generic_const_exprs#108172Conversation
|
The core issue here is that we do not support const arguments to const parameters that are generic (as the ICE states), the test case is a bit obfuscated since its not clear that An equivalent test case: pub trait TraitWAssocConst<T> {
const A: T;
}
fn main<T, B: TraitWAssocConst<T, A = { 1 }>>() {}ICEd before #107753 landed (on current stable it ICEs with "const parameters cannot be generic"): Backtrace
The long term fix here is for us to actually support generic const parameter types (although this is a little ways off and cannot be done right now), short term the logic for Closing this since we do want this |
|
Ah okay, that makes sense. Thanks so much for explaining! |
Fixes #108165.
In #107753, we changed several uses of
tcx.type_of(did)on consts totcx.type_of(did).no_bound_vars().expect(..)after addingEarlyBinder, one of which is causing this ICE.r? @BoxyUwU