]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/parser/type-alias-where.rs
Change syntax for TyAlias where clauses
[rust.git] / src / test / ui / parser / type-alias-where.rs
index a9fa23dd95ef4eceda62e7de1c2d340ef88f09ad..99ab8a7c48ccf44c7d2bd40c0c876e950229aa96 100644 (file)
@@ -6,9 +6,9 @@
 type Foo where u32: Copy = ();
 // Not fine.
 type Bar = () where u32: Copy;
-//~^ ERROR where clause not allowed here
+//~^ ERROR where clauses are not allowed
 type Baz = () where;
-//~^ ERROR where clause not allowed here
+//~^ ERROR where clauses are not allowed
 
 trait Trait {
     // Fine.
@@ -18,19 +18,19 @@ trait Trait {
 }
 
 impl Trait for u32 {
-    // Fine.
+    // Not fine, suggests moving.
     type Assoc where u32: Copy = ();
-    // Not fine, suggests moving `i32: Copy`
+    //~^ ERROR where clause not allowed here
+    // Not fine, suggests moving `u32: Copy`
     type Assoc2 where u32: Copy = () where i32: Copy;
     //~^ ERROR where clause not allowed here
 }
 
 impl Trait for i32 {
-    // Not fine, suggests moving `u32: Copy`
+    // Fine.
     type Assoc = () where u32: Copy;
-    //~^ ERROR where clause not allowed here
     // Not fine, suggests moving both.
-    type Assoc2 = () where u32: Copy, i32: Copy;
+    type Assoc2 where u32: Copy, i32: Copy = ();
     //~^ ERROR where clause not allowed here
 }