#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
-trait UnwrapItemsExt<const C: usize> {
+trait UnwrapItemsExt<'a, const C: usize> {
type Iter;
fn unwrap_items(self) -> Self::Iter;
}
const MY_CONST: usize;
}
-impl<'a, const C: usize> MyTrait<'a, {C}> for MyStruct<{C}> {
+impl<'a, const C: usize> MyTrait<'a, { C }> for MyStruct<{ C }> {
type MyItem = u8;
const MY_CONST: usize = C;
}
-impl<'a, I, const C: usize> UnwrapItemsExt<{C}> for I
-where
-{
- type Iter = impl MyTrait<'a, {C}>;
+impl<'a, I, const C: usize> UnwrapItemsExt<'a, { C }> for I {
+ type Iter = impl MyTrait<'a, { C }>;
fn unwrap_items(self) -> Self::Iter {
- MyStruct::<{C}> {}
+ MyStruct::<{ C }> {}
}
}