]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/type-alias-impl-trait/assoc-type-const.rs
New upstream version 1.43.0+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / assoc-type-const.rs
index 5db677d82e2663ae97bb51764fe3bb5b8f2220f7..2907c21c6203c5372564697326236eb644e36763 100644 (file)
@@ -6,7 +6,7 @@
 #![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;
 }
@@ -18,18 +18,16 @@ trait MyTrait<'a, const C: usize> {
     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 }> {}
     }
 }