1 // Tests that we properly detect defining usages when using
2 // const generics in an associated opaque type
5 #![feature(type_alias_impl_trait)]
7 trait UnwrapItemsExt<'a, const C: usize> {
9 fn unwrap_items(self) -> Self::Iter;
12 struct MyStruct<const C: usize> {}
14 trait MyTrait<'a, const C: usize> {
16 const MY_CONST: usize;
19 impl<'a, const C: usize> MyTrait<'a, C> for MyStruct<C> {
21 const MY_CONST: usize = C;
24 impl<'a, I, const C: usize> UnwrapItemsExt<'a, C> for I {
25 type Iter = impl MyTrait<'a, C>;
27 fn unwrap_items(self) -> Self::Iter {