summaryrefslogtreecommitdiffstats
path: root/src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs b/src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs
new file mode 100644
index 000000000..c463a8ad0
--- /dev/null
+++ b/src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs
@@ -0,0 +1,17 @@
+fn foo1<T:Copy<U>, U>(x: T) {}
+//~^ ERROR this trait takes 0 generic arguments but 1 generic argument was supplied
+
+trait Trait: Copy<dyn Send> {}
+//~^ ERROR this trait takes 0 generic arguments but 1 generic argument was supplied
+
+struct MyStruct1<T: Copy<T>>;
+//~^ ERROR this trait takes 0 generic arguments but 1 generic argument was supplied
+
+struct MyStruct2<'a, T: Copy<'a>>;
+//~^ ERROR this trait takes 0 lifetime arguments but 1 lifetime argument was supplied
+
+fn foo2<'a, T:Copy<'a, U>, U>(x: T) {}
+//~^ ERROR this trait takes 0 lifetime arguments but 1 lifetime argument was supplied
+//~| ERROR this trait takes 0 generic arguments but 1 generic argument was supplied
+
+fn main() { }