Repository navigation
CTFE const pattern bodies that normalization leaves generic - #166077
lapla-cogito wants to merge 1 commit into
Conversation
|
Some changes occurred in match checking cc @Nadrieril |
|
thanks for the PR! I believe this approach is a little wonky, and is masked a little bit by the fact that after #165070 on Feel free to poke me in the const generics zulip, this is a quite difficult and complex theoretical change that I've been thinking about how to solve for a couple months now! @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
@bit-aloo mentioned this in zulip: #![feature(gca_min_const_items)]
#![feature(gca_const_items)]
trait Trait {
const A: usize;
}
fn f<T: Trait<A = 3>>(n: usize) -> bool {
match n {
T::A => true,
_ => false,
}
}unsure, but at the very least, this should be a test that's checked in, its behavior currently isn't tracked |
Under
gca_const_items, normalization leaves a const pattern as an alias when its generic arguments still mention parameters, even if the body does not use them. Evaluate that remaining body with CTFE so it can be used as a pattern.Fixes #162679
r? khyperia