Update Tests

This commit is contained in:
Veera 2024-09-01 22:27:43 -04:00
parent 94885bc699
commit 265cd14cd4
54 changed files with 409 additions and 0 deletions

View File

@ -0,0 +1,6 @@
trait Animal {
Type Result = u8;
//~^ ERROR expected one of
}
fn main() {}

View File

@ -0,0 +1,13 @@
error: expected one of `!` or `::`, found `Result`
--> $DIR/assoc-type.rs:2:10
|
LL | trait Animal {
| - while parsing this item list starting here
LL | Type Result = u8;
| ^^^^^^ expected one of `!` or `::`
LL |
LL | }
| - the item list ends here
error: aborting due to 1 previous error

View File

@ -0,0 +1,6 @@
//@ edition: 2018
fn main() {
async Move {}
//~^ ERROR expected one of
}

View File

@ -0,0 +1,8 @@
error: expected one of `move`, `|`, or `||`, found `Move`
--> $DIR/async-move.rs:4:11
|
LL | async Move {}
| ^^^^ expected one of `move`, `|`, or `||`
error: aborting due to 1 previous error

View File

@ -0,0 +1,5 @@
cnst fn code() {}
//~^ ERROR expected one of
fn main() {
}

View File

@ -0,0 +1,8 @@
error: expected one of `!` or `::`, found keyword `fn`
--> $DIR/const-fn.rs:1:6
|
LL | cnst fn code() {}
| ^^ expected one of `!` or `::`
error: aborting due to 1 previous error

View File

@ -0,0 +1,4 @@
fn foo<consta N: usize>(_arr: [i32; N]) {}
//~^ ERROR expected one of
fn main() {}

View File

@ -0,0 +1,8 @@
error: expected one of `,`, `:`, `=`, or `>`, found `N`
--> $DIR/const-generics.rs:1:15
|
LL | fn foo<consta N: usize>(_arr: [i32; N]) {}
| ^ expected one of `,`, `:`, `=`, or `>`
error: aborting due to 1 previous error

View File

@ -0,0 +1,4 @@
cons A: u8 = 10;
//~^ ERROR expected one of
fn main() {}

View File

@ -0,0 +1,8 @@
error: expected one of `!` or `::`, found `A`
--> $DIR/const.rs:1:6
|
LL | cons A: u8 = 10;
| ^ expected one of `!` or `::`
error: aborting due to 1 previous error

View File

@ -0,0 +1,4 @@
fn main() {
form i in 1..10 {}
//~^ ERROR expected one of
}

View File

@ -0,0 +1,8 @@
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `i`
--> $DIR/for-loop.rs:2:10
|
LL | form i in 1..10 {}
| ^ expected one of 8 possible tokens
error: aborting due to 1 previous error

View File

@ -0,0 +1,16 @@
struct Closure<F> {
data: (u8, u16),
func: F,
}
impl<F> Closure<F>
Where for<'a> F: Fn(&'a (u8, u16)) -> &'a u8,
//~^ ERROR expected one of
{
fn call(&self) -> &u8 {
(self.func)(&self.data)
}
}
fn main() {}

View File

@ -0,0 +1,8 @@
error: expected one of `!`, `(`, `+`, `::`, `<`, `where`, or `{`, found keyword `for`
--> $DIR/hrdt.rs:7:11
|
LL | Where for<'a> F: Fn(&'a (u8, u16)) -> &'a u8,
| ^^^ expected one of 7 possible tokens
error: aborting due to 1 previous error

View File

@ -0,0 +1,6 @@
struct Human;
ipml Human {}
//~^ ERROR expected one of
fn main() {}

View File

@ -0,0 +1,8 @@
error: expected one of `!` or `::`, found `Human`
--> $DIR/impl-block.rs:3:6
|
LL | ipml Human {}
| ^^^^^ expected one of `!` or `::`
error: aborting due to 1 previous error

View File

@ -0,0 +1,4 @@
fn code() -> Impl Display {}
//~^ ERROR expected one of
fn main() {}

View File

@ -0,0 +1,8 @@
error: expected one of `!`, `(`, `+`, `::`, `<`, `where`, or `{`, found `Display`
--> $DIR/impl-return.rs:1:19
|
LL | fn code() -> Impl Display {}
| ^^^^^^^ expected one of 7 possible tokens
error: aborting due to 1 previous error

View File

@ -0,0 +1,6 @@
struct Human;
impl Debug form Human {}
//~^ ERROR expected one of
fn main() {}

View File

@ -0,0 +1,8 @@
error: expected one of `!`, `(`, `+`, `::`, `<`, `where`, or `{`, found `Human`
--> $DIR/impl-trait-for.rs:3:17
|
LL | impl Debug form Human {}
| ^^^^^ expected one of 7 possible tokens
error: aborting due to 1 previous error

View File

@ -0,0 +1,4 @@
fn code<T: impll Debug>() -> u8 {}
//~^ ERROR expected one of
fn main() {}

View File

@ -0,0 +1,13 @@
error: expected one of `(`, `+`, `,`, `::`, `<`, `=`, or `>`, found `Debug`
--> $DIR/impl-trait.rs:1:18
|
LL | fn code<T: impll Debug>() -> u8 {}
| ^^^^^ expected one of 7 possible tokens
|
help: you might have meant to end the type parameters here
|
LL | fn code<T: impll> Debug>() -> u8 {}
| +
error: aborting due to 1 previous error

View File

@ -0,0 +1,4 @@
fn main() {
let Some(a) = Some(10) elze {}
//~^ ERROR expected one of
}

View File

@ -0,0 +1,8 @@
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `elze`
--> $DIR/let-else.rs:2:28
|
LL | let Some(a) = Some(10) elze {}
| ^^^^ expected one of `.`, `;`, `?`, `else`, or an operator
error: aborting due to 1 previous error

View File

@ -0,0 +1,4 @@
fn main() {
let muta a = 10;
//~^ ERROR expected one of
}

View File

@ -0,0 +1,8 @@
error: expected one of `:`, `;`, `=`, `@`, or `|`, found `a`
--> $DIR/let-mut.rs:2:14
|
LL | let muta a = 10;
| ^ expected one of `:`, `;`, `=`, `@`, or `|`
error: aborting due to 1 previous error

View File

@ -0,0 +1,9 @@
fn main() {
Let a = 10;
//~^ ERROR expected one of
}
fn code() {
lett a = 10;
//~^ ERROR expected one of
}

View File

@ -0,0 +1,14 @@
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `a`
--> $DIR/let.rs:2:9
|
LL | Let a = 10;
| ^ expected one of 8 possible tokens
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `a`
--> $DIR/let.rs:7:10
|
LL | lett a = 10;
| ^ expected one of 8 possible tokens
error: aborting due to 2 previous errors

View File

@ -0,0 +1,5 @@
fn main() {
let a = 10;
matche a {}
//~^ ERROR expected one of
}

View File

@ -0,0 +1,8 @@
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `a`
--> $DIR/match.rs:3:12
|
LL | matche a {}
| ^ expected one of 8 possible tokens
error: aborting due to 1 previous error

View File

@ -0,0 +1,4 @@
mode parser;
//~^ ERROR expected one of
fn main() {}

View File

@ -0,0 +1,8 @@
error: expected one of `!` or `::`, found `parser`
--> $DIR/mod.rs:1:6
|
LL | mode parser;
| ^^^^^^ expected one of `!` or `::`
error: aborting due to 1 previous error

View File

@ -0,0 +1,5 @@
puB fn code() {}
//~^ ERROR expected one of
fn main() {
}

View File

@ -0,0 +1,8 @@
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`
--> $DIR/pub-fn.rs:1:1
|
LL | puB fn code() {}
| ^^^ expected one of 21 possible tokens
error: aborting due to 1 previous error

View File

@ -0,0 +1,9 @@
fn main() {
let a = Some(vec![1, 2]);
match a {
Some(refe list) => println!("{list:?}"),
//~^ ERROR expected one of
//~| ERROR this pattern has 2 fields,
_ => println!("none"),
}
}

View File

@ -0,0 +1,20 @@
error: expected one of `)`, `,`, `@`, or `|`, found `list`
--> $DIR/ref.rs:4:19
|
LL | Some(refe list) => println!("{list:?}"),
| -^^^^ expected one of `)`, `,`, `@`, or `|`
| |
| help: missing `,`
error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 1 field
--> $DIR/ref.rs:4:14
|
LL | Some(refe list) => println!("{list:?}"),
| ^^^^ ^^^^ expected 1 field, found 2
--> $SRC_DIR/core/src/option.rs:LL:COL
|
= note: tuple variant has 1 field
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0023`.

View File

@ -0,0 +1,7 @@
fn code() -> u8 {
let a = 10;
returnn a;
//~^ ERROR expected one of
}
fn main() {}

View File

@ -0,0 +1,8 @@
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `a`
--> $DIR/return.rs:3:13
|
LL | returnn a;
| ^ expected one of 8 possible tokens
error: aborting due to 1 previous error

View File

@ -0,0 +1,5 @@
static muta a: u8 = 0;
//~^ ERROR expected one of
//~| ERROR missing type for
fn main() {}

View File

@ -0,0 +1,19 @@
error: expected one of `:`, `;`, or `=`, found `a`
--> $DIR/static-mut.rs:1:13
|
LL | static muta a: u8 = 0;
| ^ expected one of `:`, `;`, or `=`
error: missing type for `static` item
--> $DIR/static-mut.rs:1:12
|
LL | static muta a: u8 = 0;
| ^
|
help: provide a type for the item
|
LL | static muta: <type> a: u8 = 0;
| ++++++++
error: aborting due to 2 previous errors

View File

@ -0,0 +1,4 @@
Static a = 0;
//~^ ERROR expected one of
fn main() {}

View File

@ -0,0 +1,8 @@
error: expected one of `!` or `::`, found `a`
--> $DIR/static.rs:1:8
|
LL | Static a = 0;
| ^ expected one of `!` or `::`
error: aborting due to 1 previous error

View File

@ -0,0 +1,4 @@
Struct Foor {
//~^ ERROR expected one of
hello: String,
}

View File

@ -0,0 +1,8 @@
error: expected one of `!` or `::`, found `Foor`
--> $DIR/struct.rs:1:8
|
LL | Struct Foor {
| ^^^^ expected one of `!` or `::`
error: aborting due to 1 previous error

View File

@ -0,0 +1,4 @@
unsafee fn code() {}
//~^ ERROR expected one of
fn main() {}

View File

@ -0,0 +1,8 @@
error: expected one of `!` or `::`, found keyword `fn`
--> $DIR/unsafe-fn.rs:1:9
|
LL | unsafee fn code() {}
| ^^ expected one of `!` or `::`
error: aborting due to 1 previous error

View File

@ -0,0 +1,4 @@
usee a::b;
//~^ ERROR expected one of
fn main() {}

View File

@ -0,0 +1,8 @@
error: expected one of `!` or `::`, found `a`
--> $DIR/use.rs:1:6
|
LL | usee a::b;
| ^ expected one of `!` or `::`
error: aborting due to 1 previous error

View File

@ -0,0 +1,8 @@
fn code<T>() -> u8
wheree
//~^ ERROR expected one of
T: Debug,
{
}
fn main() {}

View File

@ -0,0 +1,10 @@
error: expected one of `!`, `(`, `+`, `::`, `<`, `where`, or `{`, found `wheree`
--> $DIR/where-clause.rs:2:1
|
LL | fn code<T>() -> u8
| - expected one of 7 possible tokens
LL | wheree
| ^^^^^^ unexpected token
error: aborting due to 1 previous error

View File

@ -0,0 +1,7 @@
fn main() {
whilee a < b {
//~^ ERROR expected one of
}
}

View File

@ -0,0 +1,8 @@
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `a`
--> $DIR/while-loop.rs:2:12
|
LL | whilee a < b {
| ^ expected one of 8 possible tokens
error: aborting due to 1 previous error

View File

@ -0,0 +1,4 @@
fn main() {
whilee 2 > 1 {}
//~^ ERROR expected one of
}

View File

@ -0,0 +1,8 @@
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `2`
--> $DIR/while-without-identifiers.rs:2:12
|
LL | whilee 2 > 1 {}
| ^ expected one of 8 possible tokens
error: aborting due to 1 previous error