Extend test to trigger on 2015, 2018 and 2021 editions
This commit is contained in:
parent
999a0dc300
commit
6f388ef1fb
@ -1,4 +0,0 @@
|
||||
//@ run-rustfix
|
||||
fn main() {
|
||||
println!("hello world"); //~ ERROR unterminated character literal
|
||||
}
|
@ -1,4 +1,8 @@
|
||||
//@ run-rustfix
|
||||
//@ revisions: rust2015 rust2018 rust2021
|
||||
//@[rust2018] edition:2018
|
||||
//@[rust2021] edition:2021
|
||||
fn main() {
|
||||
println!('hello world'); //~ ERROR unterminated character literal
|
||||
println!('hello world');
|
||||
//[rust2015,rust2018,rust2021]~^ ERROR unterminated character literal
|
||||
//[rust2021]~^^ ERROR prefix `world` is unknown
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
error[E0762]: unterminated character literal
|
||||
--> $DIR/lex-bad-str-literal-as-char-3.rs:3:26
|
||||
--> $DIR/lex-bad-str-literal-as-char-3.rs:5:26
|
||||
|
|
||||
LL | println!('hello world');
|
||||
| ^^^^
|
||||
| ^^^
|
||||
|
|
||||
help: if you meant to write a string literal, use double quotes
|
||||
|
|
14
tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2018.stderr
Normal file
14
tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2018.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error[E0762]: unterminated character literal
|
||||
--> $DIR/lex-bad-str-literal-as-char-3.rs:5:26
|
||||
|
|
||||
LL | println!('hello world');
|
||||
| ^^^
|
||||
|
|
||||
help: if you meant to write a string literal, use double quotes
|
||||
|
|
||||
LL | println!("hello world");
|
||||
| ~ ~
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0762`.
|
26
tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2021.stderr
Normal file
26
tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2021.stderr
Normal file
@ -0,0 +1,26 @@
|
||||
error: prefix `world` is unknown
|
||||
--> $DIR/lex-bad-str-literal-as-char-3.rs:5:21
|
||||
|
|
||||
LL | println!('hello world');
|
||||
| ^^^^^ unknown prefix
|
||||
|
|
||||
= note: prefixed identifiers and literals are reserved since Rust 2021
|
||||
help: if you meant to write a string literal, use double quotes
|
||||
|
|
||||
LL | println!("hello world");
|
||||
| ~ ~
|
||||
|
||||
error[E0762]: unterminated character literal
|
||||
--> $DIR/lex-bad-str-literal-as-char-3.rs:5:26
|
||||
|
|
||||
LL | println!('hello world');
|
||||
| ^^^
|
||||
|
|
||||
help: if you meant to write a string literal, use double quotes
|
||||
|
|
||||
LL | println!("hello world");
|
||||
| ~ ~
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0762`.
|
Loading…
Reference in New Issue
Block a user