summaryrefslogtreecommitdiffstats
path: root/src/test/ui/parser/bounds-lifetime.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/parser/bounds-lifetime.rs')
-rw-r--r--src/test/ui/parser/bounds-lifetime.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/parser/bounds-lifetime.rs b/src/test/ui/parser/bounds-lifetime.rs
new file mode 100644
index 000000000..c9251ac53
--- /dev/null
+++ b/src/test/ui/parser/bounds-lifetime.rs
@@ -0,0 +1,11 @@
+type A = for<'a:> fn(); // OK
+type A = for<'a:,> fn(); // OK
+type A = for<'a> fn(); // OK
+type A = for<> fn(); // OK
+type A = for<'a: 'b + 'c> fn(); // OK (rejected later by ast_validation)
+type A = for<'a: 'b,> fn(); // OK(rejected later by ast_validation)
+type A = for<'a: 'b +> fn(); // OK (rejected later by ast_validation)
+type A = for<'a, T> fn(); // OK (rejected later by ast_validation)
+type A = for<,> fn(); //~ ERROR expected one of `#`, `>`, `const`, identifier, or lifetime
+
+fn main() {}