diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/issue-10412.rs (renamed from src/test/parse-fail/issue-10412.rs) | 14 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-46311.rs | 14 | ||||
| -rw-r--r-- | src/test/compile-fail/lifetime-no-keyword.rs (renamed from src/test/parse-fail/lifetime-no-keyword.rs) | 6 |
3 files changed, 22 insertions, 12 deletions
diff --git a/src/test/parse-fail/issue-10412.rs b/src/test/compile-fail/issue-10412.rs index d723d94c02c..20421bfc7c4 100644 --- a/src/test/parse-fail/issue-10412.rs +++ b/src/test/compile-fail/issue-10412.rs @@ -8,20 +8,18 @@ // 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 + fn serialize(val : &'self T) -> Vec<u8> ; + fn deserialize(repr : &[u8]) -> &'self T; } -impl<'self> Serializable<str> for &'self str { //~ ERROR lifetimes cannot use keyword names +impl<'self> Serializable<str> for &'self str { //~^ ERROR lifetimes cannot use keyword names - fn serialize(val : &'self str) -> Vec<u8> { //~ ERROR lifetimes cannot use keyword names + //~| ERROR missing lifetime specifier + fn serialize(val : &'self str) -> Vec<u8> { vec![1] } - fn deserialize(repr: &[u8]) -> &'self str { //~ ERROR lifetimes cannot use keyword names + fn deserialize(repr: &[u8]) -> &'self str { "hi" } } diff --git a/src/test/compile-fail/issue-46311.rs b/src/test/compile-fail/issue-46311.rs new file mode 100644 index 00000000000..82f55f2c142 --- /dev/null +++ b/src/test/compile-fail/issue-46311.rs @@ -0,0 +1,14 @@ +// Copyright 2012-2014 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. + +fn main() { + 'break: loop { //~ ERROR invalid label name `'break` + } +} diff --git a/src/test/parse-fail/lifetime-no-keyword.rs b/src/test/compile-fail/lifetime-no-keyword.rs index a8771ae93af..e2465663dd0 100644 --- a/src/test/parse-fail/lifetime-no-keyword.rs +++ b/src/test/compile-fail/lifetime-no-keyword.rs @@ -8,11 +8,9 @@ // 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 baz<'let>(a: &'let isize) { } //~ ERROR lifetimes cannot use keyword names +fn zab<'self>(a: &'self isize) { } //~ ERROR lifetimes cannot use keyword names fn main() { } |
