forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#123680 - compiler-errors:gen-kw, r=Nadrieril Deny gen keyword in `edition_2024_compat` lints Splits the `keyword_idents` lint into two -- `keyword_idents_2018` and `keyword_idents_2024` -- since each corresponds to a future-compat warning in a different edition. Group these together into a new `keyword_idents` lint group, and add the latter to the `rust_2024_compatibility` so that `gen` is ready for the 2024 edition. cc `@traviscross` `@ehuss`
- Loading branch information
Showing
16 changed files
with
158 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
error: `gen` is a keyword in the 2024 edition | ||
--> $DIR/gen-kw.rs:6:4 | ||
| | ||
LL | fn gen() {} | ||
| ^^^ help: you can use a raw identifier to stay compatible: `r#gen` | ||
| | ||
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! | ||
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716> | ||
note: the lint level is defined here | ||
--> $DIR/gen-kw.rs:4:9 | ||
| | ||
LL | #![deny(rust_2024_compatibility)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
= note: `#[deny(keyword_idents_2024)]` implied by `#[deny(rust_2024_compatibility)]` | ||
|
||
error: `gen` is a keyword in the 2024 edition | ||
--> $DIR/gen-kw.rs:12:9 | ||
| | ||
LL | let gen = r#gen; | ||
| ^^^ help: you can use a raw identifier to stay compatible: `r#gen` | ||
| | ||
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! | ||
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716> | ||
|
||
error: aborting due to 2 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
error: `gen` is a keyword in the 2024 edition | ||
--> $DIR/gen-kw.rs:6:4 | ||
| | ||
LL | fn gen() {} | ||
| ^^^ help: you can use a raw identifier to stay compatible: `r#gen` | ||
| | ||
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024! | ||
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716> | ||
note: the lint level is defined here | ||
--> $DIR/gen-kw.rs:4:9 | ||
| | ||
LL | #![deny(rust_2024_compatibility)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
= note: `#[deny(keyword_idents_2024)]` implied by `#[deny(rust_2024_compatibility)]` | ||
|
||
error: `gen` is a keyword in the 2024 edition | ||
--> $DIR/gen-kw.rs:12:9 | ||
| | ||
LL | let gen = r#gen; | ||
| ^^^ help: you can use a raw identifier to stay compatible: `r#gen` | ||
| | ||
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024! | ||
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716> | ||
|
||
error: aborting due to 2 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//@ revisions: e2015 e2018 | ||
//@[e2018] edition: 2018 | ||
|
||
#![deny(rust_2024_compatibility)] | ||
|
||
fn gen() {} | ||
//~^ ERROR `gen` is a keyword in the 2024 edition | ||
//[e2015]~| WARNING this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! | ||
//[e2018]~| WARNING this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024! | ||
|
||
fn main() { | ||
let gen = r#gen; | ||
//~^ ERROR `gen` is a keyword in the 2024 edition | ||
//[e2015]~| WARNING this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! | ||
//[e2018]~| WARNING this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2024! | ||
} |