-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keyword-idents-2024 unable to migrate loop labels or lifetimes #125986
Comments
As a secondary concern, it is also unable to migrate proc-macro attributes or derives. For example: #[my_proc_macro::gen]
struct S;
// or
#[derive(my_proc_macro::gen)]
struct S; Here the path is not getting updated with the There were no crater hits on this, but this does seem like something that could be supported. |
@rustbot labels -I-edition-nominated We discussed this today in the edition call. We're OK accepting this for the edition. We'll use this issue to track that we add appropriate documentation here. Two other alternatives that are worth exploring:
|
One other alternative that might be worth considering: say that in Rust 2024 |
With the merge of #126335, this now works: pub fn label() {
'r#gen: loop {
break 'r#gen;
}
}
pub fn lifetime<'r#gen>() {} |
The
keyword-idents-2024
lint is not able to catch the use of'gen
used as a lifetime or a label. I believe this is because there is no raw syntax available for lifetimes or labels, and thus no way to make it work on both editions (without choosing a new name). I do not see any discussion of this in rust-lang/rfcs#2151 which introduced raw identifiers.I'm not sure what our options are here. It could just pick some different name. Another option is to punt on automatic migration and just document this limitation.
Preliminary crater found in the following:
cc #123904 @compiler-errors
Meta
rustc --version --verbose
:Tracking issue:
gen
keyword #123904Related:
The text was updated successfully, but these errors were encountered: