Reserve gen
keyword for gen {}
blocks and gen fn
in 2024 edition
This commit is contained in:
parent
ccb160d343
commit
a61cf673cd
14 changed files with 138 additions and 4 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue