提交 7977250f 编写于 作者: V Vadim Petrochenkov

Make sure all ui/parse tests have `-Z parse-only`

Except those testing parsing during macro expansion
上级 64c0efab
......@@ -8,5 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
#[path =] //~ ERROR unexpected token: `]`
mod m {}
error: unexpected token: `]`
--> $DIR/attr-bad-meta-2.rs:11:9
--> $DIR/attr-bad-meta-2.rs:13:9
|
LL | #[path =] //~ ERROR unexpected token: `]`
| ^ unexpected token after this
......
......@@ -8,5 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
#[path() token] //~ ERROR expected `]`, found `token`
mod m {}
error: expected `]`, found `token`
--> $DIR/attr-bad-meta-3.rs:11:10
--> $DIR/attr-bad-meta-3.rs:13:10
|
LL | #[path() token] //~ ERROR expected `]`, found `token`
| ^^^^^ expected `]`
......
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
#![feature(unrestricted_attribute_tokens)]
#[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
......
error: expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
--> $DIR/attr-bad-meta.rs:13:7
--> $DIR/attr-bad-meta.rs:15:7
|
LL | #[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
| ^ expected one of `(`, `::`, `=`, `[`, `]`, or `{` here
......
......@@ -11,6 +11,8 @@
// Test that we cannot parse a closure with an explicit return type
// unless it uses braces.
// compile-flags: -Z parse-only
fn main() {
let x = || -> i32 22;
//~^ ERROR expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22`
......
error: expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22`
--> $DIR/closure-return-syntax.rs:15:23
--> $DIR/closure-return-syntax.rs:17:23
|
LL | let x = || -> i32 22;
| ^^ expected one of `!`, `(`, `+`, `::`, `<`, or `{` here
......
......@@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z continue-parse-after-error
// compile-flags: -Z parse-only -Z continue-parse-after-error
struct X {
a: u8 /** document a */,
......
......@@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z continue-parse-after-error
// compile-flags: -Z parse-only -Z continue-parse-after-error
fn main() {
/// document
//~^ ERROR found a documentation comment that doesn't document anything
......
error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/doc-before-fn-rbrace.rs:13:5
--> $DIR/doc-before-fn-rbrace.rs:14:5
|
LL | /// document
| ^^^^^^^^^^^^
......
......@@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z continue-parse-after-error
// compile-flags: -Z parse-only -Z continue-parse-after-error
fn /// document
foo() {}
//~^^ ERROR expected identifier, found `/// document`
......
error: expected identifier, found `/// document`
--> $DIR/doc-before-identifier.rs:12:4
--> $DIR/doc-before-identifier.rs:13:4
|
LL | fn /// document
| ^^^^^^^^^^^^ expected identifier
......
......@@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z continue-parse-after-error
// compile-flags: -Z parse-only -Z continue-parse-after-error
mod Foo {
/// document
//~^ ERROR expected item after doc comment
......
error: expected item after doc comment
--> $DIR/doc-before-mod-rbrace.rs:13:5
--> $DIR/doc-before-mod-rbrace.rs:14:5
|
LL | /// document
| ^^^^^^^^^^^^
error[E0601]: `main` function not found in crate `doc_before_mod_rbrace`
|
= note: consider adding a `main` function to `$DIR/doc-before-mod-rbrace.rs`
error: aborting due to 2 previous errors
error: aborting due to previous error
For more information about this error, try `rustc --explain E0601`.
......@@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z continue-parse-after-error
// compile-flags: -Z parse-only -Z continue-parse-after-error
struct X {
a: u8,
/// document
......
error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/doc-before-struct-rbrace-1.rs:14:5
--> $DIR/doc-before-struct-rbrace-1.rs:15:5
|
LL | /// document
| ^^^^^^^^^^^^
......
......@@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z continue-parse-after-error
// compile-flags: -Z parse-only -Z continue-parse-after-error
struct X {
a: u8 /// document
//~^ ERROR found a documentation comment that doesn't document anything
......
error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/doc-before-struct-rbrace-2.rs:13:11
--> $DIR/doc-before-struct-rbrace-2.rs:14:11
|
LL | a: u8 /// document
| ^^^^^^^^^^^^
......
......@@ -8,4 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
extern crte foo; //~ ERROR expected one of `crate`, `fn`, or `{`, found `crte`
error: expected one of `crate`, `fn`, or `{`, found `crte`
--> $DIR/extern-crate-unexpected-token.rs:11:8
--> $DIR/extern-crate-unexpected-token.rs:13:8
|
LL | extern crte foo; //~ ERROR expected one of `crate`, `fn`, or `{`, found `crte`
| ^^^^ expected one of `crate`, `fn`, or `{` here
......
// compile-flags: -Z parse-only
fn main() {
for i in in 1..2 {
println!("{}", i);
......
error: expected iterable, found keyword `in`
--> $DIR/if-in-in.rs:2:14
--> $DIR/if-in-in.rs:4:14
|
LL | for i in in 1..2 {
| ---^^
......
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
struct S;
impl S {
......
error: expected one of `:` or `@`, found `bar`
--> $DIR/inverted-parameters.rs:14:24
--> $DIR/inverted-parameters.rs:16:24
|
LL | fn foo(&self, &str bar) {}
| -----^^^
......@@ -8,7 +8,7 @@ LL | fn foo(&self, &str bar) {}
| help: declare the type after the parameter binding: `<identifier>: <type>`
error: expected one of `:` or `@`, found `quux`
--> $DIR/inverted-parameters.rs:20:10
--> $DIR/inverted-parameters.rs:22:10
|
LL | fn baz(S quux, xyzzy: i32) {}
| --^^^^
......@@ -17,25 +17,25 @@ LL | fn baz(S quux, xyzzy: i32) {}
| help: declare the type after the parameter binding: `<identifier>: <type>`
error: expected one of `:` or `@`, found `a`
--> $DIR/inverted-parameters.rs:25:12
--> $DIR/inverted-parameters.rs:27:12
|
LL | fn one(i32 a b) {}
| ^ expected one of `:` or `@` here
error: expected `:`, found `(`
--> $DIR/inverted-parameters.rs:28:23
--> $DIR/inverted-parameters.rs:30:23
|
LL | fn pattern((i32, i32) (a, b)) {}
| ^ expected `:`
error: expected one of `:` or `@`, found `)`
--> $DIR/inverted-parameters.rs:31:12
--> $DIR/inverted-parameters.rs:33:12
|
LL | fn fizz(i32) {}
| ^ expected one of `:` or `@` here
error: expected one of `:` or `@`, found `S`
--> $DIR/inverted-parameters.rs:34:23
--> $DIR/inverted-parameters.rs:36:23
|
LL | fn missing_colon(quux S) {}
| -----^
......
......@@ -11,6 +11,8 @@
// FIXME(31528) we emit a bunch of silly errors here due to continuing past the
// first one. This would be easy-ish to address by better recovery in tokenisation.
// compile-flags: -Z parse-only
pub fn trace_option(option: Option<isize>) {
option.map(|some| 42;
//~^ ERROR: expected one of
......
error: incorrect close delimiter: `}`
--> $DIR/issue-10636-2.rs:18:1
--> $DIR/issue-10636-2.rs:20:1
|
LL | pub fn trace_option(option: Option<isize>) {
| - close delimiter possibly meant for this
......@@ -10,13 +10,13 @@ LL | } //~ ERROR: incorrect close delimiter
| ^ incorrect close delimiter
error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;`
--> $DIR/issue-10636-2.rs:15:25
--> $DIR/issue-10636-2.rs:17:25
|
LL | option.map(|some| 42;
| ^ expected one of `)`, `,`, `.`, `?`, or an operator here
error: expected expression, found `)`
--> $DIR/issue-10636-2.rs:18:1
--> $DIR/issue-10636-2.rs:20:1
|
LL | } //~ ERROR: incorrect close delimiter
| ^ expected expression
......
......@@ -8,12 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
use std::io;
fn main(){
let x: io::IoResult<()> = Ok(());
//~^ ERROR cannot find type `IoResult` in module `io`
//~| NOTE did you mean `Result`?
match x {
Err(ref e) if e.kind == io::EndOfFile {
//~^ NOTE while parsing this struct
......
......@@ -16,12 +16,5 @@ LL | //~^ NOTE expected one of `.`, `=>`, `?`, or an operator here
LL | _ => {}
| ^ unexpected token
error[E0412]: cannot find type `IoResult` in module `io`
--> $DIR/issue-15980.rs:14:16
|
LL | let x: io::IoResult<()> = Ok(());
| ^^^^^^^^ did you mean `Result`?
error: aborting due to 3 previous errors
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0412`.
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
fn main() {
let caller<F> = |f: F| //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
where F: Fn() -> i32
......
error: expected one of `:`, `;`, `=`, or `@`, found `<`
--> $DIR/issue-22647.rs:12:15
--> $DIR/issue-22647.rs:14:15
|
LL | let caller<F> = |f: F| //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
| ^ expected one of `:`, `;`, `=`, or `@` here
......
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
struct Foo<B> {
buffer: B
}
......
error: expected one of `:`, `;`, `=`, or `@`, found `<`
--> $DIR/issue-22712.rs:16:12
--> $DIR/issue-22712.rs:18:12
|
LL | let Foo<Vec<u8>> //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
| ^ expected one of `:`, `;`, `=`, or `@` here
......
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
fn main() {
let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
}
error: expected one of `:`, `;`, `=`, or `@`, found `[`
--> $DIR/issue-24197.rs:12:12
--> $DIR/issue-24197.rs:14:12
|
LL | let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
| ^ expected one of `:`, `;`, `=`, or `@` here
......
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
static tmp : [&'static str; 2] = ["hello", "he"];
fn main() {
......
error: expected one of `=>`, `@`, `if`, or `|`, found `[`
--> $DIR/issue-24375.rs:16:12
--> $DIR/issue-24375.rs:18:12
|
LL | tmp[0] => {} //~ ERROR expected one of `=>`, `@`, `if`, or `|`, found `[`
| ^ expected one of `=>`, `@`, `if`, or `|` here
......
......@@ -8,4 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
use foo.bar; //~ ERROR expected one of `::`, `;`, or `as`, found `.`
error: expected one of `::`, `;`, or `as`, found `.`
--> $DIR/issue-33455.rs:11:8
--> $DIR/issue-33455.rs:13:8
|
LL | use foo.bar; //~ ERROR expected one of `::`, `;`, or `as`, found `.`
| ^ expected one of `::`, `;`, or `as` here
......
......@@ -8,7 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
impl S { //~ ERROR cannot find type
// compile-flags: -Z parse-only
impl S {
pub
} //~ ERROR expected one of
......
error: expected one of `(`, `async`, `const`, `default`, `existential`, `extern`, `fn`, `type`, or `unsafe`, found `}`
--> $DIR/issue-41155.rs:13:1
--> $DIR/issue-41155.rs:15:1
|
LL | pub
| - expected one of 9 possible tokens here
LL | } //~ ERROR expected one of
| ^ unexpected token
error[E0412]: cannot find type `S` in this scope
--> $DIR/issue-41155.rs:11:6
|
LL | impl S { //~ ERROR cannot find type
| ^ not found in this scope
error: aborting due to 2 previous errors
error: aborting due to previous error
For more information about this error, try `rustc --explain E0412`.
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
fn test(&'a str) {
//~^ ERROR unexpected lifetime `'a` in pattern
}
......
error: unexpected lifetime `'a` in pattern
--> $DIR/lifetime-in-pattern.rs:11:10
--> $DIR/lifetime-in-pattern.rs:13:10
|
LL | fn test(&'a str) {
| ^^ unexpected lifetime
......
......@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z no-analysis
macro_rules! foo {
{ $+ } => { //~ ERROR expected identifier, found `+`
//~^ ERROR missing fragment specifier
......
error: expected identifier, found `+`
--> $DIR/issue-33569.rs:14:8
--> $DIR/issue-33569.rs:12:8
|
LL | { $+ } => { //~ ERROR expected identifier, found `+`
| ^
error: expected `*` or `+`
--> $DIR/issue-33569.rs:16:13
--> $DIR/issue-33569.rs:14:13
|
LL | $(x)(y) //~ ERROR expected `*` or `+`
| ^^^
error: missing fragment specifier
--> $DIR/issue-33569.rs:14:8
--> $DIR/issue-33569.rs:12:8
|
LL | { $+ } => { //~ ERROR expected identifier, found `+`
| ^
......
......@@ -8,12 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:18:3
// compile-flags: -Z parse-only
// error-pattern:19:3
/* 1
* 2
* 3
*/
fn main() {
%; // parse error on line 18, but is reported on line 6 instead.
%; // parse error on line 19, but is reported on line 6 instead.
}
error: expected expression, found `%`
--> $DIR/multiline-comment-line-tracking.rs:18:3
--> $DIR/multiline-comment-line-tracking.rs:19:3
|
LL | %; // parse error on line 18, but is reported on line 6 instead.
LL | %; // parse error on line 19, but is reported on line 6 instead.
| ^ expected expression
error: aborting due to previous error
......
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
fn main() {
match 42 {
x < 7 => (),
......
error: expected one of `=>`, `@`, `if`, or `|`, found `<`
--> $DIR/pat-lt-bracket-1.rs:13:7
--> $DIR/pat-lt-bracket-1.rs:15:7
|
LL | x < 7 => (),
| ^ expected one of `=>`, `@`, `if`, or `|` here
......
......@@ -8,5 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
fn a(B<) {}
//~^ error: expected one of `:` or `@`, found `<`
error: expected one of `:` or `@`, found `<`
--> $DIR/pat-lt-bracket-2.rs:11:7
--> $DIR/pat-lt-bracket-2.rs:13:7
|
LL | fn a(B<) {}
| ^ expected one of `:` or `@` here
error[E0601]: `main` function not found in crate `pat_lt_bracket_2`
|
= note: consider adding a `main` function to `$DIR/pat-lt-bracket-2.rs`
error: aborting due to 2 previous errors
error: aborting due to previous error
For more information about this error, try `rustc --explain E0601`.
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
struct Foo<T>(T, T);
impl<T> Foo<T> {
......
error: expected one of `=>`, `@`, `if`, or `|`, found `<`
--> $DIR/pat-lt-bracket-3.rs:16:16
--> $DIR/pat-lt-bracket-3.rs:18:16
|
LL | Foo<T>(x, y) => {
| ^ expected one of `=>`, `@`, `if`, or `|` here
error[E0601]: `main` function not found in crate `pat_lt_bracket_3`
|
= note: consider adding a `main` function to `$DIR/pat-lt-bracket-3.rs`
error: aborting due to 2 previous errors
error: aborting due to previous error
For more information about this error, try `rustc --explain E0601`.
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
fn main() {
let v[0] = v[1]; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
}
error: expected one of `:`, `;`, `=`, or `@`, found `[`
--> $DIR/pat-lt-bracket-5.rs:12:10
--> $DIR/pat-lt-bracket-5.rs:14:10
|
LL | let v[0] = v[1]; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
| ^ expected one of `:`, `;`, `=`, or `@` here
......
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
fn main() {
let Test(&desc[..]) = x; //~ ERROR: expected one of `)`, `,`, or `@`, found `[`
}
error: expected one of `)`, `,`, or `@`, found `[`
--> $DIR/pat-lt-bracket-6.rs:12:19
--> $DIR/pat-lt-bracket-6.rs:14:19
|
LL | let Test(&desc[..]) = x; //~ ERROR: expected one of `)`, `,`, or `@`, found `[`
| ^ expected one of `)`, `,`, or `@` here
......
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
fn main() {
for thing(x[]) in foo {} //~ ERROR: expected one of `)`, `,`, or `@`, found `[`
}
error: expected one of `)`, `,`, or `@`, found `[`
--> $DIR/pat-lt-bracket-7.rs:12:16
--> $DIR/pat-lt-bracket-7.rs:14:16
|
LL | for thing(x[]) in foo {} //~ ERROR: expected one of `)`, `,`, or `@`, found `[`
| ^ expected one of `)`, `,`, or `@` here
......
......@@ -10,6 +10,8 @@
// Parsing of range patterns
// compile-flags: -Z parse-only
fn main() {
let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, or `=`, found `..=`
}
error: expected one of `:`, `;`, or `=`, found `..=`
--> $DIR/pat-ranges-1.rs:14:21
--> $DIR/pat-ranges-1.rs:16:21
|
LL | let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, or `=`, found `..=`
| ^^^ expected one of `:`, `;`, or `=` here
......
......@@ -10,6 +10,8 @@
// Parsing of range patterns
// compile-flags: -Z parse-only
fn main() {
let 10 ..= makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, or `=`, found `!`
}
error: expected one of `::`, `:`, `;`, or `=`, found `!`
--> $DIR/pat-ranges-2.rs:14:26
--> $DIR/pat-ranges-2.rs:16:26
|
LL | let 10 ..= makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, or `=`, found `!`
| ^ expected one of `::`, `:`, `;`, or `=` here
......
......@@ -10,6 +10,8 @@
// Parsing of range patterns
// compile-flags: -Z parse-only
fn main() {
let 10 ..= 10 + 3 = 12; //~ expected one of `:`, `;`, or `=`, found `+`
}
error: expected one of `:`, `;`, or `=`, found `+`
--> $DIR/pat-ranges-3.rs:14:19
--> $DIR/pat-ranges-3.rs:16:19
|
LL | let 10 ..= 10 + 3 = 12; //~ expected one of `:`, `;`, or `=`, found `+`
| ^ expected one of `:`, `;`, or `=` here
......
......@@ -10,6 +10,8 @@
// Parsing of range patterns
// compile-flags: -Z parse-only
fn main() {
let 10 - 3 ..= 10 = 8;
//~^ error: expected one of `...`, `..=`, `..`, `:`, `;`, or `=`, found `-`
......
error: expected one of `...`, `..=`, `..`, `:`, `;`, or `=`, found `-`
--> $DIR/pat-ranges-4.rs:14:12
--> $DIR/pat-ranges-4.rs:16:12
|
LL | let 10 - 3 ..= 10 = 8;
| ^ expected one of `...`, `..=`, `..`, `:`, `;`, or `=` here
......
......@@ -10,6 +10,8 @@
// Issue #18317
// compile-flags: -Z parse-only
mod bleh {
macro_rules! defn {
($n:ident) => (
......
error: can't qualify macro invocation with `pub`
--> $DIR/pub-method-macro.rs:27:9
--> $DIR/pub-method-macro.rs:29:9
|
LL | pub defn!(f); //~ ERROR can't qualify macro invocation with `pub`
| ^^^
......
......@@ -10,8 +10,9 @@
// Make sure that inclusive ranges with no end point don't parse.
// compile-flags: -Z parse-only
pub fn main() {
for _ in 1..= {} //~ERROR inclusive range with no end
//~^HELP bounded at the end
}
error[E0586]: inclusive range with no end
--> $DIR/range_inclusive.rs:14:19
--> $DIR/range_inclusive.rs:16:19
|
LL | for _ in 1..= {} //~ERROR inclusive range with no end
| ^
......
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
fn main() {
let x = r##"lol"#;
//~^ ERROR unterminated raw string
......
error: unterminated raw string
--> $DIR/raw_string.rs:12:13
--> $DIR/raw_string.rs:14:13
|
LL | let x = r##"lol"#;
| ^ unterminated raw string
......
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
trait Trait<'a> {}
fn main() {
......
error[E0178]: expected a path on the left-hand side of `+`, not `&for<'a> Trait<'a>`
--> $DIR/trait-object-polytrait-priority.rs:14:12
--> $DIR/trait-object-polytrait-priority.rs:16:12
|
LL | let _: &for<'a> Trait<'a> + 'static;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try adding parentheses: `&(for<'a> Trait<'a> + 'static)`
......
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
trait Foo {
pub const Foo: u32;
//~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found
......
error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub`
--> $DIR/trait-pub-assoc-const.rs:12:5
--> $DIR/trait-pub-assoc-const.rs:14:5
|
LL | trait Foo {
| - expected one of 7 possible tokens here
......
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
trait Foo {
pub type Foo;
//~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found
......
error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub`
--> $DIR/trait-pub-assoc-ty.rs:12:5
--> $DIR/trait-pub-assoc-ty.rs:14:5
|
LL | trait Foo {
| - expected one of 7 possible tokens here
......
......@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only
trait Foo {
pub fn foo();
//~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册