]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/type-alias-impl-trait/assoc-type-const.rs
5db677d82e2663ae97bb51764fe3bb5b8f2220f7
1 // Tests that we properly detect defining usages when using
2 // const generics in an associated opaque type
5 #![feature(type_alias_impl_trait)]
6 #![feature(const_generics)]
7 //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
9 trait UnwrapItemsExt
<const C
: usize> {
11 fn unwrap_items(self) -> Self::Iter
;
14 struct MyStruct
<const C
: usize> {}
16 trait MyTrait
<'a
, const C
: usize> {
18 const MY_CONST
: usize;
21 impl<'a
, const C
: usize> MyTrait
<'a
, {C}
> for MyStruct
<{C}
> {
23 const MY_CONST
: usize = C
;
26 impl<'a
, I
, const C
: usize> UnwrapItemsExt
<{C}
> for I
29 type Iter
= impl MyTrait
<'a
, {C}
>;
31 fn unwrap_items(self) -> Self::Iter
{