diff options
Diffstat (limited to 'src/test/parse-fail')
| -rw-r--r-- | src/test/parse-fail/brace-after-qualified-path-in-match.rs | 17 | ||||
| -rw-r--r-- | src/test/parse-fail/issue-20711-2.rs | 2 | ||||
| -rw-r--r-- | src/test/parse-fail/issue-20711.rs | 2 | ||||
| -rw-r--r-- | src/test/parse-fail/issue-21153.rs | 2 | ||||
| -rw-r--r-- | src/test/parse-fail/paren-after-qualified-path-in-match.rs | 17 | ||||
| -rw-r--r-- | src/test/parse-fail/removed-syntax-static-fn.rs | 2 | ||||
| -rw-r--r-- | src/test/parse-fail/trait-pub-assoc-const.rs | 16 | ||||
| -rw-r--r-- | src/test/parse-fail/trait-pub-assoc-ty.rs | 3 | ||||
| -rw-r--r-- | src/test/parse-fail/trait-pub-method.rs | 3 |
9 files changed, 58 insertions, 6 deletions
diff --git a/src/test/parse-fail/brace-after-qualified-path-in-match.rs b/src/test/parse-fail/brace-after-qualified-path-in-match.rs new file mode 100644 index 00000000000..66f462df05a --- /dev/null +++ b/src/test/parse-fail/brace-after-qualified-path-in-match.rs @@ -0,0 +1,17 @@ +// Copyright 2015 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 foo() { + match x { + <T as Trait>::Type{key: value} => (), + //~^ ERROR unexpected `{` after qualified path + _ => (), + } +} diff --git a/src/test/parse-fail/issue-20711-2.rs b/src/test/parse-fail/issue-20711-2.rs index 2c993b7654e..be6bd516d6f 100644 --- a/src/test/parse-fail/issue-20711-2.rs +++ b/src/test/parse-fail/issue-20711-2.rs @@ -16,6 +16,6 @@ impl Foo { fn foo() {} #[stable(feature = "rust1", since = "1.0.0")] -} //~ ERROR expected one of `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}` +} //~ ERROR expected one of `const`, `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}` fn main() {} diff --git a/src/test/parse-fail/issue-20711.rs b/src/test/parse-fail/issue-20711.rs index 8462bd8fd01..d1d8d3acf91 100644 --- a/src/test/parse-fail/issue-20711.rs +++ b/src/test/parse-fail/issue-20711.rs @@ -14,6 +14,6 @@ struct Foo; impl Foo { #[stable(feature = "rust1", since = "1.0.0")] -} //~ ERROR expected one of `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}` +} //~ ERROR expected one of `const`, `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}` fn main() {} diff --git a/src/test/parse-fail/issue-21153.rs b/src/test/parse-fail/issue-21153.rs index 44d979ba979..76a4687f544 100644 --- a/src/test/parse-fail/issue-21153.rs +++ b/src/test/parse-fail/issue-21153.rs @@ -11,5 +11,5 @@ // compile-flags: -Z parse-only trait MyTrait<T>: Iterator { - Item = T; //~ ERROR expected one of `extern`, `fn`, `type`, or `unsafe`, found `Item` + Item = T; //~ ERROR expected one of `const`, `extern`, `fn`, `type`, or `unsafe`, found `Item` } diff --git a/src/test/parse-fail/paren-after-qualified-path-in-match.rs b/src/test/parse-fail/paren-after-qualified-path-in-match.rs new file mode 100644 index 00000000000..d06fd2bb4e7 --- /dev/null +++ b/src/test/parse-fail/paren-after-qualified-path-in-match.rs @@ -0,0 +1,17 @@ +// Copyright 2015 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 foo() { + match x { + <T as Trait>::Type(2) => (), + //~^ ERROR unexpected `(` after qualified path + _ => (), + } +} diff --git a/src/test/parse-fail/removed-syntax-static-fn.rs b/src/test/parse-fail/removed-syntax-static-fn.rs index be1e89dd717..7b6caad86b6 100644 --- a/src/test/parse-fail/removed-syntax-static-fn.rs +++ b/src/test/parse-fail/removed-syntax-static-fn.rs @@ -14,5 +14,5 @@ struct S; impl S { static fn f() {} - //~^ ERROR expected one of `extern`, `fn`, `pub`, `type`, `unsafe`, or `}`, found `static` } +//~^^ ERROR expected one of `const`, `extern`, `fn`, `pub`, `type`, `unsafe`, or `}`, found `static` diff --git a/src/test/parse-fail/trait-pub-assoc-const.rs b/src/test/parse-fail/trait-pub-assoc-const.rs new file mode 100644 index 00000000000..adce0d7bbf4 --- /dev/null +++ b/src/test/parse-fail/trait-pub-assoc-const.rs @@ -0,0 +1,16 @@ +// Copyright 2015 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. + +trait Foo { + pub const Foo: u32; + //~^ ERROR expected one of `const`, `extern`, `fn`, `type`, or `unsafe`, found `pub` +} + +fn main() {} diff --git a/src/test/parse-fail/trait-pub-assoc-ty.rs b/src/test/parse-fail/trait-pub-assoc-ty.rs index 02d76234d4e..dab6c433aba 100644 --- a/src/test/parse-fail/trait-pub-assoc-ty.rs +++ b/src/test/parse-fail/trait-pub-assoc-ty.rs @@ -9,7 +9,8 @@ // except according to those terms. trait Foo { - pub type Foo; //~ ERROR expected one of `extern`, `fn`, `type`, or `unsafe`, found `pub` + pub type Foo; + //~^ ERROR expected one of `const`, `extern`, `fn`, `type`, or `unsafe`, found `pub` } fn main() {} diff --git a/src/test/parse-fail/trait-pub-method.rs b/src/test/parse-fail/trait-pub-method.rs index e76802d2ea0..7cb9363830c 100644 --- a/src/test/parse-fail/trait-pub-method.rs +++ b/src/test/parse-fail/trait-pub-method.rs @@ -9,7 +9,8 @@ // except according to those terms. trait Foo { - pub fn foo(); //~ ERROR expected one of `extern`, `fn`, `type`, or `unsafe`, found `pub` + pub fn foo(); + //~^ ERROR expected one of `const`, `extern`, `fn`, `type`, or `unsafe`, found `pub` } fn main() {} |
