diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-10-05 11:30:55 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-10-26 06:49:17 +0000 |
| commit | a61cf673cd10ed24394c3403e03d8f7cf1f50170 (patch) | |
| tree | dbf3c9adb68cb079695fc7b2e6999f162aeb42dd /compiler/rustc_span/src | |
| parent | ccb160d3432dff025ab62696a82e576bf08aa006 (diff) | |
| download | rust-a61cf673cd10ed24394c3403e03d8f7cf1f50170.tar.gz rust-a61cf673cd10ed24394c3403e03d8f7cf1f50170.zip | |
Reserve `gen` keyword for `gen {}` blocks and `gen fn` in 2024 edition
Diffstat (limited to 'compiler/rustc_span/src')
| -rw-r--r-- | compiler/rustc_span/src/symbol.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index ff61143a12b..8ef16ed0dbf 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -98,6 +98,7 @@ symbols! { Builtin: "builtin", Catch: "catch", Default: "default", + Gen: "gen", MacroRules: "macro_rules", Raw: "raw", Union: "union", @@ -2188,8 +2189,9 @@ impl Symbol { self >= kw::Abstract && self <= kw::Yield } - fn is_unused_keyword_conditional(self, edition: impl FnOnce() -> Edition) -> bool { - self == kw::Try && edition() >= Edition::Edition2018 + fn is_unused_keyword_conditional(self, edition: impl Copy + FnOnce() -> Edition) -> bool { + self == kw::Try && edition().at_least_rust_2018() + || self == kw::Gen && edition().at_least_rust_2024() } pub fn is_reserved(self, edition: impl Copy + FnOnce() -> Edition) -> bool { |
