Move parse-fail tests to UI

This commit is contained in:
Vadim Petrochenkov 2018-10-20 23:36:17 +03:00
parent 554b7874a9
commit 73e1f8970f
541 changed files with 3128 additions and 0 deletions

View File

@ -0,0 +1,20 @@
error: this form of character escape may only be used with characters in the range [/x00-/x7f]
--> $DIR/ascii-only-character-escape.rs:14:16
|
LL | let x = "/x80"; //~ ERROR may only be used
| ^^
error: this form of character escape may only be used with characters in the range [/x00-/x7f]
--> $DIR/ascii-only-character-escape.rs:15:16
|
LL | let y = "/xff"; //~ ERROR may only be used
| ^^
error: this form of character escape may only be used with characters in the range [/x00-/x7f]
--> $DIR/ascii-only-character-escape.rs:16:16
|
LL | let z = "/xe2"; //~ ERROR may only be used
| ^^
error: aborting due to 3 previous errors

View File

@ -0,0 +1,8 @@
error: expected one of `.`, `;`, `?`, or `}`, found `[`
--> $DIR/assoc-oddities-1.rs:20:28
|
LL | ..if c { a } else { b }[n]; //~ ERROR expected one of
| ^ expected one of `.`, `;`, `?`, or `}` here
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected one of `.`, `;`, `?`, or `}`, found `[`
--> $DIR/assoc-oddities-2.rs:15:29
|
LL | x..if c { a } else { b }[n]; //~ ERROR expected one of
| ^ expected one of `.`, `;`, `?`, or `}` here
error: aborting due to previous error

View File

@ -0,0 +1,14 @@
error: expected identifier, found keyword `for`
--> $DIR/associated-types-project-from-hrtb-explicit.rs:22:21
|
LL | fn foo2<I>(x: <I as for<'x> Foo<&'x isize>>::A)
| ^^^ expected identifier, found keyword
error: expected one of `::` or `>`, found `Foo`
--> $DIR/associated-types-project-from-hrtb-explicit.rs:22:29
|
LL | fn foo2<I>(x: <I as for<'x> Foo<&'x isize>>::A)
| ^^^ expected one of `::` or `>` here
error: aborting due to 2 previous errors

View File

@ -0,0 +1,8 @@
error: unexpected token: `]`
--> $DIR/attr-bad-meta-2.rs:11:9
|
LL | #[path =] //~ ERROR unexpected token: `]`
| ^ unexpected token after this
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected `]`, found `token`
--> $DIR/attr-bad-meta-3.rs:11:10
|
LL | #[path() token] //~ ERROR expected `]`, found `token`
| ^^^^^ expected `]`
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
--> $DIR/attr-bad-meta.rs:13:7
|
LL | #[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
| ^ expected one of `(`, `::`, `=`, `[`, `]`, or `{` here
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected item after attributes
--> $DIR/attr-before-eof.rs:13:16
|
LL | #[derive(Debug)] //~ERROR expected item after attributes
| ^
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected statement after outer attribute
--> $DIR/attr-dangling-in-fn.rs:17:1
|
LL | }
| ^
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected item after attributes
--> $DIR/attr-dangling-in-mod.rs:18:14
|
LL | #[foo = "bar"]
| ^
error: aborting due to previous error

View File

@ -0,0 +1,10 @@
error: an inner attribute is not permitted in this context
--> $DIR/attr.rs:17:3
|
LL | #![lang(foo)] //~ ERROR an inner attribute is not permitted in this context
| ^
|
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected item after attributes
--> $DIR/attrs-after-extern-mod.rs:22:19
|
LL | #[cfg(stage37)] //~ ERROR expected item after attributes
| ^
error: aborting due to previous error

View File

@ -0,0 +1,28 @@
error: character constant must be escaped: '
--> $DIR/bad-char-literals.rs:17:6
|
LL | ''';
| ^
error: character constant must be escaped: /n
--> $DIR/bad-char-literals.rs:21:6
|
LL | '
| ______^
LL | | ';
| |_
error: character constant must be escaped: /r
--> $DIR/bad-char-literals.rs:26:6
|
LL | ' '; //~ ERROR: character constant must be escaped: /r
| ^
error: character constant must be escaped: /t
--> $DIR/bad-char-literals.rs:29:6
|
LL | ' ';
| ^^^^
error: aborting due to 4 previous errors

View File

@ -0,0 +1,114 @@
error: ABI spec with a suffix is invalid
--> $DIR/bad-lit-suffixes.rs:15:5
|
LL | "C"suffix //~ ERROR ABI spec with a suffix is invalid
| ^^^^^^^^^
error: ABI spec with a suffix is invalid
--> $DIR/bad-lit-suffixes.rs:19:5
|
LL | "C"suffix //~ ERROR ABI spec with a suffix is invalid
| ^^^^^^^^^
error: string literal with a suffix is invalid
--> $DIR/bad-lit-suffixes.rs:23:5
|
LL | ""suffix; //~ ERROR string literal with a suffix is invalid
| ^^^^^^^^
error: byte string literal with a suffix is invalid
--> $DIR/bad-lit-suffixes.rs:24:5
|
LL | b""suffix; //~ ERROR byte string literal with a suffix is invalid
| ^^^^^^^^^
error: string literal with a suffix is invalid
--> $DIR/bad-lit-suffixes.rs:25:5
|
LL | r#""#suffix; //~ ERROR string literal with a suffix is invalid
| ^^^^^^^^^^^
error: byte string literal with a suffix is invalid
--> $DIR/bad-lit-suffixes.rs:26:5
|
LL | br#""#suffix; //~ ERROR byte string literal with a suffix is invalid
| ^^^^^^^^^^^^
error: char literal with a suffix is invalid
--> $DIR/bad-lit-suffixes.rs:27:5
|
LL | 'a'suffix; //~ ERROR char literal with a suffix is invalid
| ^^^^^^^^^
error: byte literal with a suffix is invalid
--> $DIR/bad-lit-suffixes.rs:28:5
|
LL | b'a'suffix; //~ ERROR byte literal with a suffix is invalid
| ^^^^^^^^^^
error: invalid width `1024` for integer literal
--> $DIR/bad-lit-suffixes.rs:30:5
|
LL | 1234u1024; //~ ERROR invalid width `1024` for integer literal
| ^^^^^^^^^
|
= help: valid widths are 8, 16, 32, 64 and 128
error: invalid width `1024` for integer literal
--> $DIR/bad-lit-suffixes.rs:31:5
|
LL | 1234i1024; //~ ERROR invalid width `1024` for integer literal
| ^^^^^^^^^
|
= help: valid widths are 8, 16, 32, 64 and 128
error: invalid width `1024` for float literal
--> $DIR/bad-lit-suffixes.rs:32:5
|
LL | 1234f1024; //~ ERROR invalid width `1024` for float literal
| ^^^^^^^^^
|
= help: valid widths are 32 and 64
error: invalid width `1024` for float literal
--> $DIR/bad-lit-suffixes.rs:33:5
|
LL | 1234.5f1024; //~ ERROR invalid width `1024` for float literal
| ^^^^^^^^^^^
|
= help: valid widths are 32 and 64
error: invalid suffix `suffix` for numeric literal
--> $DIR/bad-lit-suffixes.rs:35:5
|
LL | 1234suffix; //~ ERROR invalid suffix `suffix` for numeric literal
| ^^^^^^^^^^
|
= help: the suffix must be one of the integral types (`u32`, `isize`, etc)
error: invalid suffix `suffix` for numeric literal
--> $DIR/bad-lit-suffixes.rs:36:5
|
LL | 0b101suffix; //~ ERROR invalid suffix `suffix` for numeric literal
| ^^^^^^^^^^^
|
= help: the suffix must be one of the integral types (`u32`, `isize`, etc)
error: invalid suffix `suffix` for float literal
--> $DIR/bad-lit-suffixes.rs:37:5
|
LL | 1.0suffix; //~ ERROR invalid suffix `suffix` for float literal
| ^^^^^^^^^
|
= help: valid suffixes are `f32` and `f64`
error: invalid suffix `suffix` for float literal
--> $DIR/bad-lit-suffixes.rs:38:5
|
LL | 1.0e10suffix; //~ ERROR invalid suffix `suffix` for float literal
| ^^^^^^^^^^^^
|
= help: valid suffixes are `f32` and `f64`
error: aborting due to 16 previous errors

View File

@ -0,0 +1,8 @@
error: expected one of `:`, `;`, `=`, or `@`, found `x`
--> $DIR/bad-match.rs:16:13
|
LL | let isize x = 5;
| ^ expected one of `:`, `;`, `=`, or `@` here
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected one of `:`, `;`, `=`, or `@`, found `.`
--> $DIR/bad-name.rs:16:8
|
LL | let x.y::<isize>.z foo;
| ^ expected one of `:`, `;`, `=`, or `@` here
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate)
--> $DIR/bad-pointer-type.rs:13:11
|
LL | fn foo(_: *()) {
| ^
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected identifier, found keyword `false`
--> $DIR/bad-value-ident-false.rs:13:4
|
LL | fn false() { } //~ ERROR expected identifier, found keyword `false`
| ^^^^^ expected identifier, found keyword
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected identifier, found keyword `true`
--> $DIR/bad-value-ident-true.rs:13:4
|
LL | fn true() { } //~ ERROR expected identifier, found keyword `true`
| ^^^^ expected identifier, found keyword
error: aborting due to previous error

View File

@ -0,0 +1,10 @@
error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3`
--> $DIR/better-expected.rs:14:19
|
LL | let x: [isize 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3`
| - ^ expected one of 7 possible tokens here
| |
| while parsing the type for `x`
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected `,`
--> $DIR/bind-struct-early-modifiers.rs:16:19
|
LL | Foo { ref x: ref x } => {}, //~ ERROR expected `,`
| ^
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected identifier, found `>`
--> $DIR/bound-single-question-mark.rs:13:10
|
LL | fn f<T: ?>() {} //~ ERROR expected identifier, found `>`
| ^ expected identifier
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected one of `,`, `:`, or `>`, found `'b`
--> $DIR/bounds-lifetime-1.rs:13:17
|
LL | type A = for<'a 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `'b`
| ^^ expected one of `,`, `:`, or `>` here
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected one of `,`, `:`, or `>`, found `+`
--> $DIR/bounds-lifetime-2.rs:13:17
|
LL | type A = for<'a + 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `+`
| ^ expected one of `,`, `:`, or `>` here
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected `:`, found `;`
--> $DIR/bounds-lifetime-where-1.rs:13:16
|
LL | type A where 'a; //~ ERROR expected `:`, found `;`
| ^ expected `:`
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected one of `=`, lifetime, or type, found `,`
--> $DIR/bounds-lifetime-where.rs:20:14
|
LL | type A where , = u8; //~ ERROR expected one of `=`, lifetime, or type, found `,`
| ^ expected one of `=`, lifetime, or type here
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected one of `>`, identifier, or lifetime, found `,`
--> $DIR/bounds-lifetime.rs:21:14
|
LL | type A = for<,> fn(); //~ ERROR expected one of `>`, identifier, or lifetime, found `,`
| ^ expected one of `>`, identifier, or lifetime here
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected one of `!`, `(`, `+`, `::`, `:`, `<`, `==`, or `=`, found `,`
--> $DIR/bounds-type-where.rs:20:15
|
LL | type A where T, = u8;
| ^ expected one of 8 possible tokens here
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: `?` may only modify trait bounds, not lifetime bounds
--> $DIR/bounds-type.rs:20:8
|
LL | T: ?'a, //~ ERROR `?` may only modify trait bounds, not lifetime bounds
| ^
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: unexpected `{` after qualified path
--> $DIR/brace-after-qualified-path-in-match.rs:15:27
|
LL | <T as Trait>::Type{key: value} => (),
| ^ unexpected `{` after qualified path
error: aborting due to previous error

View File

@ -0,0 +1,44 @@
error: unknown byte escape: f
--> $DIR/byte-literals.rs:16:21
|
LL | static FOO: u8 = b'/f'; //~ ERROR unknown byte escape
| ^
error: unknown byte escape: f
--> $DIR/byte-literals.rs:19:8
|
LL | b'/f'; //~ ERROR unknown byte escape
| ^
error: invalid character in numeric character escape: Z
--> $DIR/byte-literals.rs:20:10
|
LL | b'/x0Z'; //~ ERROR invalid character in numeric character escape: Z
| ^
error: byte constant must be escaped: /t
--> $DIR/byte-literals.rs:21:7
|
LL | b' '; //~ ERROR byte constant must be escaped
| ^^^^
error: byte constant must be escaped: '
--> $DIR/byte-literals.rs:22:7
|
LL | b'''; //~ ERROR byte constant must be escaped
| ^
error: byte constant must be ASCII. Use a /xHH escape for a non-ASCII byte
--> $DIR/byte-literals.rs:23:7
|
LL | b'é'; //~ ERROR byte constant must be ASCII
| ^
error: unterminated byte constant: b'a
--> $DIR/byte-literals.rs:24:5
|
LL | b'a //~ ERROR unterminated byte constant
| ^^^
error: aborting due to 7 previous errors

View File

@ -0,0 +1,34 @@
error: unknown byte escape: f
--> $DIR/byte-string-literals.rs:16:32
|
LL | static FOO: &'static [u8] = b"/f"; //~ ERROR unknown byte escape
| ^
error: unknown byte escape: f
--> $DIR/byte-string-literals.rs:19:8
|
LL | b"/f"; //~ ERROR unknown byte escape
| ^
error: invalid character in numeric character escape: Z
--> $DIR/byte-string-literals.rs:20:10
|
LL | b"/x0Z"; //~ ERROR invalid character in numeric character escape: Z
| ^
error: byte constant must be ASCII. Use a /xHH escape for a non-ASCII byte
--> $DIR/byte-string-literals.rs:21:7
|
LL | b"é"; //~ ERROR byte constant must be ASCII
| ^
error: unterminated double quote byte string
--> $DIR/byte-string-literals.rs:22:7
|
LL | b"a //~ ERROR unterminated double quote byte string
| _______^
LL | | }
| |__^
error: aborting due to 5 previous errors

View File

@ -0,0 +1,8 @@
error: circular modules: $DIR/circular_modules_hello.rs -> $DIR/circular_modules_main.rs -> $DIR/circular_modules_hello.rs
--> $DIR/circular_modules_main.rs:14:5
|
LL | mod circular_modules_hello; //~ ERROR: circular modules
| ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected one of `!` or `::`, found `cat`
--> $DIR/class-implements-bad-trait.rs:14:7
|
LL | class cat : nonexistent {
| ^^^ expected one of `!` or `::` here
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22`
--> $DIR/closure-return-syntax.rs:15:23
|
LL | let x = || -> i32 22;
| ^^ expected one of `!`, `(`, `+`, `::`, `<`, or `{` here
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected `[`, found `<eof>`
--> $DIR/column-offset-1-based.rs:13:1
|
LL | # //~ ERROR 13:1: 13:2: expected `[`, found `<eof>`
| ^ expected `[`
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected one of `async`, `const`, `existential`, `extern`, `fn`, `type`, or `unsafe`, found `pub`
--> $DIR/default.rs:32:13
|
LL | default pub fn foo<T: Default>() -> T { T::default() } //~ ERROR expected one of
| ^^^ expected one of 7 possible tokens here
error: aborting due to previous error

View File

@ -0,0 +1,10 @@
error: found removed `do catch` syntax
--> $DIR/do-catch-suggests-try.rs:14:25
|
LL | let _: Option<()> = do catch {};
| ^^
|
= help: Following RFC #2388, the new non-placeholder syntax is `try`
error: aborting due to previous error

View File

@ -0,0 +1,19 @@
error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/doc-after-struct-field.rs:14:11
|
LL | a: u8 /** document a */,
| ^^^^^^^^^^^^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/doc-after-struct-field.rs:20:11
|
LL | a: u8 /// document a
| ^^^^^^^^^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0585`.

View File

@ -0,0 +1,8 @@
error: expected item after attributes
--> $DIR/doc-before-attr.rs:14:16
|
LL | #[derive(Debug)] //~ERROR expected item after attributes
| ^
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected item after doc comment
--> $DIR/doc-before-eof.rs:13:1
|
LL | /// hi //~ERROR expected item after doc comment
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: expected item after doc comment
--> $DIR/doc-before-extern-rbrace.rs:14:5
|
LL | /// hi
| ^^^^^^
error: aborting due to previous error

View File

@ -0,0 +1,11 @@
error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/doc-before-fn-rbrace.rs:13:5
|
LL | /// document
| ^^^^^^^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
error: aborting due to previous error
For more information about this error, try `rustc --explain E0585`.

View File

@ -0,0 +1,8 @@
error: expected identifier, found `/// document`
--> $DIR/doc-before-identifier.rs:12:4
|
LL | fn /// document
| ^^^^^^^^^^^^ expected identifier
error: aborting due to previous error

View File

@ -0,0 +1,13 @@
error: expected item after doc comment
--> $DIR/doc-before-mod-rbrace.rs:13: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
For more information about this error, try `rustc --explain E0601`.

View File

@ -0,0 +1,11 @@
error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/doc-before-rbrace.rs:14:21
|
LL | println!("Hi"); /// hi
| ^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
error: aborting due to previous error
For more information about this error, try `rustc --explain E0585`.

View File

@ -0,0 +1,11 @@
error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/doc-before-semi.rs:14:5
|
LL | /// hi
| ^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
error: aborting due to previous error
For more information about this error, try `rustc --explain E0585`.

View File

@ -0,0 +1,11 @@
error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/doc-before-struct-rbrace-1.rs:14:5
|
LL | /// document
| ^^^^^^^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
error: aborting due to previous error
For more information about this error, try `rustc --explain E0585`.

View File

@ -0,0 +1,11 @@
error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/doc-before-struct-rbrace-2.rs:13:11
|
LL | a: u8 /// document
| ^^^^^^^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
error: aborting due to previous error
For more information about this error, try `rustc --explain E0585`.

Some files were not shown because too many files have changed in this diff Show More