summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/object/vs-lifetime-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/traits/object/vs-lifetime-2.rs')
-rw-r--r--src/test/ui/traits/object/vs-lifetime-2.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/traits/object/vs-lifetime-2.rs b/src/test/ui/traits/object/vs-lifetime-2.rs
new file mode 100644
index 000000000..0b33dc7f6
--- /dev/null
+++ b/src/test/ui/traits/object/vs-lifetime-2.rs
@@ -0,0 +1,11 @@
+// A few contrived examples where lifetime should (or should not) be parsed as an object type.
+// Lifetimes parsed as types are still rejected later by semantic checks.
+
+// `'static` is a lifetime, `'static +` is a type, `'a` is a type
+fn g() where
+ 'static: 'static,
+ dyn 'static +: 'static + Copy,
+ //~^ ERROR at least one trait is required for an object type
+{}
+
+fn main() {}