diff options
Diffstat (limited to 'tests/ui/generics/generic-non-trailing-defaults.rs')
-rw-r--r-- | tests/ui/generics/generic-non-trailing-defaults.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/generics/generic-non-trailing-defaults.rs b/tests/ui/generics/generic-non-trailing-defaults.rs new file mode 100644 index 000000000..16ea71d48 --- /dev/null +++ b/tests/ui/generics/generic-non-trailing-defaults.rs @@ -0,0 +1,10 @@ +struct Heap; + +struct Vec<A = Heap, T>(A, T); +//~^ ERROR generic parameters with a default must be trailing + +struct Foo<A, B = Vec<C>, C>(A, B, C); +//~^ ERROR generic parameters with a default must be trailing +//~| ERROR generic parameters with a default cannot use + +fn main() {} |