summaryrefslogtreecommitdiffstats
path: root/tests/ui/auto-traits/bad-generics-on-dyn.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/auto-traits/bad-generics-on-dyn.rs')
-rw-r--r--tests/ui/auto-traits/bad-generics-on-dyn.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/auto-traits/bad-generics-on-dyn.rs b/tests/ui/auto-traits/bad-generics-on-dyn.rs
new file mode 100644
index 000000000..3f8ac14c7
--- /dev/null
+++ b/tests/ui/auto-traits/bad-generics-on-dyn.rs
@@ -0,0 +1,11 @@
+#![feature(auto_traits)]
+
+auto trait Trait1<'a> {}
+//~^ ERROR auto traits cannot have generic parameters
+
+fn f<'a>(x: &dyn Trait1<'a>)
+{}
+
+fn main() {
+ f(&1);
+}