about summary refs log tree commit diff
path: root/src/test/parse-fail
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-12-07 21:05:49 +0000
committerbors <bors@rust-lang.org>2017-12-07 21:05:49 +0000
commitc8ddf28527119a06a9f5da9bd34c97ae97afe531 (patch)
tree458cdc07ce837e57058f2613e8e92e036d5251da /src/test/parse-fail
parent9c49f401fecd8c5ef42a33a070a61daa2b911b47 (diff)
parent29e268060209765e5a9efb4c0941765d064e13ea (diff)
Auto merge of #46497 - AgustinCB:issue-46311, r=petrochenkov
Modify message for keyword as identifier name

This is a temporary solution to #46311.

The message is generic enough to cover both cases and is probably a fine enough solution to the specific problem described in the task. However, the underlying reason for this to be wrong is that `next_token_inner` returns `Lifetime` even if the token is a label. That's not simple, as the syntax for both can be quite similar and it may need to take a look to the next token to make a decision. I'm not sure I have enough knowledge about the project to be able to solve that (yet!), so I thought I'll fix the immediate problem first.
Diffstat (limited to 'src/test/parse-fail')
-rw-r--r--src/test/parse-fail/issue-10412.rs34
-rw-r--r--src/test/parse-fail/lifetime-no-keyword.rs18
2 files changed, 0 insertions, 52 deletions
diff --git a/src/test/parse-fail/issue-10412.rs b/src/test/parse-fail/issue-10412.rs
deleted file mode 100644
index d723d94c02c..00000000000
--- a/src/test/parse-fail/issue-10412.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// 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
-
-
-trait Serializable<'self, T> { //~ ERROR lifetimes cannot use keyword names
-    fn serialize(val : &'self T) -> Vec<u8> ; //~ ERROR lifetimes cannot use keyword names
-    fn deserialize(repr : &[u8]) -> &'self T; //~ ERROR lifetimes cannot use keyword names
-}
-
-impl<'self> Serializable<str> for &'self str { //~ ERROR lifetimes cannot use keyword names
-    //~^ ERROR lifetimes cannot use keyword names
-    fn serialize(val : &'self str) -> Vec<u8> { //~ ERROR lifetimes cannot use keyword names
-        vec![1]
-    }
-    fn deserialize(repr: &[u8]) -> &'self str { //~ ERROR lifetimes cannot use keyword names
-        "hi"
-    }
-}
-
-fn main() {
-    println!("hello");
-    let x = "foo".to_string();
-    let y = x;
-    println!("{}", y);
-}
diff --git a/src/test/parse-fail/lifetime-no-keyword.rs b/src/test/parse-fail/lifetime-no-keyword.rs
deleted file mode 100644
index a8771ae93af..00000000000
--- a/src/test/parse-fail/lifetime-no-keyword.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// 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
-
-fn foo<'a>(a: &'a isize) { }
-fn bar(a: &'static isize) { }
-fn baz(a: &'let isize) { } //~ ERROR lifetimes cannot use keyword names
-fn zab(a: &'self isize) { } //~ ERROR lifetimes cannot use keyword names
-
-fn main() { }