Open ehuss opened 1 month ago
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 r#gen
syntax.
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:
r#
syntax in lifetimes and loop labels, though this is a broader language change that would need to be proposed.cc @compiler-errors @oli-obk
One other alternative that might be worth considering: say that in Rust 2024 'gen
is still permitted as a lifetime and as a label.
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 https://github.com/rust-lang/rfcs/pull/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:
Related: