about summary refs log tree commit diff
path: root/src/test/parse-fail
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2018-03-06 11:22:24 +0100
committerRalf Jung <post@ralfj.de>2018-03-06 11:29:48 +0100
commit49abd8748357012e5db10bf11077384f727e2177 (patch)
tree21efac585e6effe851d9b05497d0aca78bb22f5d /src/test/parse-fail
parent30b5be0e9530a4de106b581074c3707e6a938329 (diff)
downloadrust-49abd8748357012e5db10bf11077384f727e2177.tar.gz
rust-49abd8748357012e5db10bf11077384f727e2177.zip
make bounds on higher-kinded lifetimes a hard error in ast_validation
Also move the check for not having type parameters into ast_validation.

I was not sure what to do with compile-fail/issue-23046.rs: The issue looks like
maybe the bounds actually played a role in triggering the ICE, but that seems
unlikely given that the compiler seems to entirely ignore them.  However, I
couldn't find a testcase without the bounds, so I figured the best I could do is
to just remove the bounds and make sure at least that keeps working.
Diffstat (limited to 'src/test/parse-fail')
-rw-r--r--src/test/parse-fail/bounds-lifetime.rs11
-rw-r--r--src/test/parse-fail/bounds-type.rs2
2 files changed, 6 insertions, 7 deletions
diff --git a/src/test/parse-fail/bounds-lifetime.rs b/src/test/parse-fail/bounds-lifetime.rs
index 5113a6b4803..88db205310c 100644
--- a/src/test/parse-fail/bounds-lifetime.rs
+++ b/src/test/parse-fail/bounds-lifetime.rs
@@ -8,17 +8,16 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z parse-only -Z continue-parse-after-error
+// compile-flags: -Z parse-only
 
-type A = for<'a: 'b + 'c> fn(); // OK
-type A = for<'a: 'b,> fn(); // OK
 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 +> fn(); // OK
-
-type A = for<'a, T> fn(); //~ ERROR only lifetime parameters can be used in this context
+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 `>`, identifier, or lifetime, found `,`
 
 fn main() {}
diff --git a/src/test/parse-fail/bounds-type.rs b/src/test/parse-fail/bounds-type.rs
index c224b44a14b..0ebe7fde0a6 100644
--- a/src/test/parse-fail/bounds-type.rs
+++ b/src/test/parse-fail/bounds-type.rs
@@ -15,7 +15,7 @@ struct S<
     T: Tr + 'a, // OK
     T: 'a, // OK
     T:, // OK
-    T: ?for<'a: 'b + 'c> Trait, // OK
+    T: ?for<'a> Trait, // OK
     T: Tr +, // OK
     T: ?'a, //~ ERROR `?` may only modify trait bounds, not lifetime bounds
 >;