003cab25d7
This commit generalizes the existing `async_idents` lint to easily encompass other identifiers that will be keywords in future editions. The new lint is called `keyword_idents` and the old `async_idents` lint is registered as renamed to this new lint. As a proof of concept the `try` keyword was added to this list as it looks to be listed as a keyword in the 2018 edition only. The `await` keyword was not added as it's not listed as a keyword yet. Closes #53077
134 lines
6.2 KiB
Plaintext
134 lines
6.2 KiB
Plaintext
error: `async` is a keyword in the 2018 edition
|
|
--> $DIR/async-ident.rs:17:4
|
|
|
|
|
LL | fn async() {} //~ ERROR async
|
|
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
|
|
|
|
note: lint level defined here
|
|
--> $DIR/async-ident.rs:12:9
|
|
|
|
|
LL | #![deny(keyword_idents)]
|
|
| ^^^^^^^^^^^^^^
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
|
|
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
|
|
|
error: `async` is a keyword in the 2018 edition
|
|
--> $DIR/async-ident.rs:22:7
|
|
|
|
|
LL | ($async:expr, async) => {};
|
|
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
|
|
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
|
|
|
error: `async` is a keyword in the 2018 edition
|
|
--> $DIR/async-ident.rs:22:19
|
|
|
|
|
LL | ($async:expr, async) => {};
|
|
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
|
|
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
|
|
|
error: `async` is a keyword in the 2018 edition
|
|
--> $DIR/async-ident.rs:36:11
|
|
|
|
|
LL | trait async {}
|
|
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
|
|
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
|
|
|
error: `async` is a keyword in the 2018 edition
|
|
--> $DIR/async-ident.rs:40:10
|
|
|
|
|
LL | impl async for MyStruct {}
|
|
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
|
|
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
|
|
|
error: `async` is a keyword in the 2018 edition
|
|
--> $DIR/async-ident.rs:46:12
|
|
|
|
|
LL | static async: u32 = 0;
|
|
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
|
|
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
|
|
|
error: `async` is a keyword in the 2018 edition
|
|
--> $DIR/async-ident.rs:52:11
|
|
|
|
|
LL | const async: u32 = 0;
|
|
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
|
|
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
|
|
|
error: `async` is a keyword in the 2018 edition
|
|
--> $DIR/async-ident.rs:58:15
|
|
|
|
|
LL | impl Foo { fn async() {} }
|
|
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
|
|
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
|
|
|
error: `async` is a keyword in the 2018 edition
|
|
--> $DIR/async-ident.rs:63:12
|
|
|
|
|
LL | struct async {}
|
|
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
|
|
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
|
|
|
error: `async` is a keyword in the 2018 edition
|
|
--> $DIR/async-ident.rs:66:9
|
|
|
|
|
LL | let async: async = async {};
|
|
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
|
|
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
|
|
|
error: `async` is a keyword in the 2018 edition
|
|
--> $DIR/async-ident.rs:66:16
|
|
|
|
|
LL | let async: async = async {};
|
|
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
|
|
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
|
|
|
error: `async` is a keyword in the 2018 edition
|
|
--> $DIR/async-ident.rs:66:24
|
|
|
|
|
LL | let async: async = async {};
|
|
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
|
|
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
|
|
|
error: `async` is a keyword in the 2018 edition
|
|
--> $DIR/async-ident.rs:77:19
|
|
|
|
|
LL | () => (pub fn async() {})
|
|
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
|
|
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
|
|
|
error: `async` is a keyword in the 2018 edition
|
|
--> $DIR/async-ident.rs:84:6
|
|
|
|
|
LL | (async) => (1)
|
|
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
|
|
|
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
|
|
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
|
|
|
error: aborting due to 14 previous errors
|
|
|