I found this with the following code:
#![allow(incomplete_features)]
#![feature(min_generic_const_args)]
pub trait Foo {
#[cfg_attr(feature = "some_feature", type_const)]
const N: usize;
}
impl Foo for u32 {
#[cfg_attr(feature = "some_feature", type_const)]
const N: usize = 99;
}
fn main() {}
If one gets rid of the cfg_attr to just #[type_const] builds just fine. Also no issue if the feature flag is off.
Build Command:
rustc test.rs --cfg 'feature="some_feature"'
rustc-ice-2026-01-17T22_27_14-1367133.txt
@rustbot label +F-min_generic_const_args +C-bug +I-ICE +T-compiler +requires-debug-assertions
I found this with the following code:
If one gets rid of the
cfg_attrto just#[type_const]builds just fine. Also no issue if the feature flag is off.Build Command:
rustc test.rs --cfg 'feature="some_feature"'rustc-ice-2026-01-17T22_27_14-1367133.txt
@rustbot label +F-min_generic_const_args +C-bug +I-ICE +T-compiler +requires-debug-assertions