Skip to content

Commit 265cd14

Browse files
Update Tests
1 parent 94885bc commit 265cd14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+409
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
trait Animal {
2+
Type Result = u8;
3+
//~^ ERROR expected one of
4+
}
5+
6+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error: expected one of `!` or `::`, found `Result`
2+
--> $DIR/assoc-type.rs:2:10
3+
|
4+
LL | trait Animal {
5+
| - while parsing this item list starting here
6+
LL | Type Result = u8;
7+
| ^^^^^^ expected one of `!` or `::`
8+
LL |
9+
LL | }
10+
| - the item list ends here
11+
12+
error: aborting due to 1 previous error
13+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ edition: 2018
2+
3+
fn main() {
4+
async Move {}
5+
//~^ ERROR expected one of
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `move`, `|`, or `||`, found `Move`
2+
--> $DIR/async-move.rs:4:11
3+
|
4+
LL | async Move {}
5+
| ^^^^ expected one of `move`, `|`, or `||`
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cnst fn code() {}
2+
//~^ ERROR expected one of
3+
4+
fn main() {
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!` or `::`, found keyword `fn`
2+
--> $DIR/const-fn.rs:1:6
3+
|
4+
LL | cnst fn code() {}
5+
| ^^ expected one of `!` or `::`
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn foo<consta N: usize>(_arr: [i32; N]) {}
2+
//~^ ERROR expected one of
3+
4+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `,`, `:`, `=`, or `>`, found `N`
2+
--> $DIR/const-generics.rs:1:15
3+
|
4+
LL | fn foo<consta N: usize>(_arr: [i32; N]) {}
5+
| ^ expected one of `,`, `:`, `=`, or `>`
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
cons A: u8 = 10;
2+
//~^ ERROR expected one of
3+
4+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!` or `::`, found `A`
2+
--> $DIR/const.rs:1:6
3+
|
4+
LL | cons A: u8 = 10;
5+
| ^ expected one of `!` or `::`
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
form i in 1..10 {}
3+
//~^ ERROR expected one of
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `i`
2+
--> $DIR/for-loop.rs:2:10
3+
|
4+
LL | form i in 1..10 {}
5+
| ^ expected one of 8 possible tokens
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
struct Closure<F> {
2+
data: (u8, u16),
3+
func: F,
4+
}
5+
6+
impl<F> Closure<F>
7+
Where for<'a> F: Fn(&'a (u8, u16)) -> &'a u8,
8+
//~^ ERROR expected one of
9+
{
10+
fn call(&self) -> &u8 {
11+
(self.func)(&self.data)
12+
}
13+
}
14+
15+
16+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!`, `(`, `+`, `::`, `<`, `where`, or `{`, found keyword `for`
2+
--> $DIR/hrdt.rs:7:11
3+
|
4+
LL | Where for<'a> F: Fn(&'a (u8, u16)) -> &'a u8,
5+
| ^^^ expected one of 7 possible tokens
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
struct Human;
2+
3+
ipml Human {}
4+
//~^ ERROR expected one of
5+
6+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!` or `::`, found `Human`
2+
--> $DIR/impl-block.rs:3:6
3+
|
4+
LL | ipml Human {}
5+
| ^^^^^ expected one of `!` or `::`
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn code() -> Impl Display {}
2+
//~^ ERROR expected one of
3+
4+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!`, `(`, `+`, `::`, `<`, `where`, or `{`, found `Display`
2+
--> $DIR/impl-return.rs:1:19
3+
|
4+
LL | fn code() -> Impl Display {}
5+
| ^^^^^^^ expected one of 7 possible tokens
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
struct Human;
2+
3+
impl Debug form Human {}
4+
//~^ ERROR expected one of
5+
6+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!`, `(`, `+`, `::`, `<`, `where`, or `{`, found `Human`
2+
--> $DIR/impl-trait-for.rs:3:17
3+
|
4+
LL | impl Debug form Human {}
5+
| ^^^^^ expected one of 7 possible tokens
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn code<T: impll Debug>() -> u8 {}
2+
//~^ ERROR expected one of
3+
4+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error: expected one of `(`, `+`, `,`, `::`, `<`, `=`, or `>`, found `Debug`
2+
--> $DIR/impl-trait.rs:1:18
3+
|
4+
LL | fn code<T: impll Debug>() -> u8 {}
5+
| ^^^^^ expected one of 7 possible tokens
6+
|
7+
help: you might have meant to end the type parameters here
8+
|
9+
LL | fn code<T: impll> Debug>() -> u8 {}
10+
| +
11+
12+
error: aborting due to 1 previous error
13+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
let Some(a) = Some(10) elze {}
3+
//~^ ERROR expected one of
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `elze`
2+
--> $DIR/let-else.rs:2:28
3+
|
4+
LL | let Some(a) = Some(10) elze {}
5+
| ^^^^ expected one of `.`, `;`, `?`, `else`, or an operator
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
let muta a = 10;
3+
//~^ ERROR expected one of
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `:`, `;`, `=`, `@`, or `|`, found `a`
2+
--> $DIR/let-mut.rs:2:14
3+
|
4+
LL | let muta a = 10;
5+
| ^ expected one of `:`, `;`, `=`, `@`, or `|`
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
fn main() {
2+
Let a = 10;
3+
//~^ ERROR expected one of
4+
}
5+
6+
fn code() {
7+
lett a = 10;
8+
//~^ ERROR expected one of
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `a`
2+
--> $DIR/let.rs:2:9
3+
|
4+
LL | Let a = 10;
5+
| ^ expected one of 8 possible tokens
6+
7+
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `a`
8+
--> $DIR/let.rs:7:10
9+
|
10+
LL | lett a = 10;
11+
| ^ expected one of 8 possible tokens
12+
13+
error: aborting due to 2 previous errors
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn main() {
2+
let a = 10;
3+
matche a {}
4+
//~^ ERROR expected one of
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `a`
2+
--> $DIR/match.rs:3:12
3+
|
4+
LL | matche a {}
5+
| ^ expected one of 8 possible tokens
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
mode parser;
2+
//~^ ERROR expected one of
3+
4+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!` or `::`, found `parser`
2+
--> $DIR/mod.rs:1:6
3+
|
4+
LL | mode parser;
5+
| ^^^^^^ expected one of `!` or `::`
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
puB fn code() {}
2+
//~^ ERROR expected one of
3+
4+
fn main() {
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `#`, `async`, `auto`, `const`, `default`, `enum`, `extern`, `fn`, `gen`, `impl`, `macro_rules`, `macro`, `mod`, `pub`, `safe`, `static`, `struct`, `trait`, `type`, `unsafe`, or `use`, found `puB`
2+
--> $DIR/pub-fn.rs:1:1
3+
|
4+
LL | puB fn code() {}
5+
| ^^^ expected one of 21 possible tokens
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
fn main() {
2+
let a = Some(vec![1, 2]);
3+
match a {
4+
Some(refe list) => println!("{list:?}"),
5+
//~^ ERROR expected one of
6+
//~| ERROR this pattern has 2 fields,
7+
_ => println!("none"),
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error: expected one of `)`, `,`, `@`, or `|`, found `list`
2+
--> $DIR/ref.rs:4:19
3+
|
4+
LL | Some(refe list) => println!("{list:?}"),
5+
| -^^^^ expected one of `)`, `,`, `@`, or `|`
6+
| |
7+
| help: missing `,`
8+
9+
error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 1 field
10+
--> $DIR/ref.rs:4:14
11+
|
12+
LL | Some(refe list) => println!("{list:?}"),
13+
| ^^^^ ^^^^ expected 1 field, found 2
14+
--> $SRC_DIR/core/src/option.rs:LL:COL
15+
|
16+
= note: tuple variant has 1 field
17+
18+
error: aborting due to 2 previous errors
19+
20+
For more information about this error, try `rustc --explain E0023`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fn code() -> u8 {
2+
let a = 10;
3+
returnn a;
4+
//~^ ERROR expected one of
5+
}
6+
7+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `a`
2+
--> $DIR/return.rs:3:13
3+
|
4+
LL | returnn a;
5+
| ^ expected one of 8 possible tokens
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
static muta a: u8 = 0;
2+
//~^ ERROR expected one of
3+
//~| ERROR missing type for
4+
5+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error: expected one of `:`, `;`, or `=`, found `a`
2+
--> $DIR/static-mut.rs:1:13
3+
|
4+
LL | static muta a: u8 = 0;
5+
| ^ expected one of `:`, `;`, or `=`
6+
7+
error: missing type for `static` item
8+
--> $DIR/static-mut.rs:1:12
9+
|
10+
LL | static muta a: u8 = 0;
11+
| ^
12+
|
13+
help: provide a type for the item
14+
|
15+
LL | static muta: <type> a: u8 = 0;
16+
| ++++++++
17+
18+
error: aborting due to 2 previous errors
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Static a = 0;
2+
//~^ ERROR expected one of
3+
4+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!` or `::`, found `a`
2+
--> $DIR/static.rs:1:8
3+
|
4+
LL | Static a = 0;
5+
| ^ expected one of `!` or `::`
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Struct Foor {
2+
//~^ ERROR expected one of
3+
hello: String,
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!` or `::`, found `Foor`
2+
--> $DIR/struct.rs:1:8
3+
|
4+
LL | Struct Foor {
5+
| ^^^^ expected one of `!` or `::`
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
unsafee fn code() {}
2+
//~^ ERROR expected one of
3+
4+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!` or `::`, found keyword `fn`
2+
--> $DIR/unsafe-fn.rs:1:9
3+
|
4+
LL | unsafee fn code() {}
5+
| ^^ expected one of `!` or `::`
6+
7+
error: aborting due to 1 previous error
8+

0 commit comments

Comments
 (0)