-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Stop using the gen
identifier in the compiler
#127729
Conversation
rustbot has assigned @petrochenkov. Use |
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a878793
to
80393ea
Compare
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
Turns out fixing the standard library is very annoying. I've limited this to the compiler and some trivial |
cc @oli-obk who may be interested in this fallout |
…-obk Stop using the `gen` identifier in the compiler In preparation for edition 2024, this PR previews the fallout of removing usages of `gen` since it's being reserved as a keyword. There are two notable changes here: 1. Had to rename `fn gen(..)` in gen/kill analysis to `gen_`. Not certain there's a better name than that. 2. There are (false?[^1]) positives in `rustc_macros` when using synstructure, which uses `gen impl` to mark an implementation. We could suppress this in a one-off way, or perhaps just ignore `gen` in macros altogether, since if an identifier ends up in expanded code then it'll get properly denied anyways. Not relevant to the compiler, but it's gonna be really annoying to change `rand`'s `gen` fn in the library and miri... [^1]: I haven't looked at the synstructure proc macro code itself so I'm not certain if it'll start to fail when converted to ed2024 (or, e.g., when syn starts parsing `gen` as a kw).
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#124921 (offset_from: always allow pointers to point to the same address) - rust-lang#127407 (Make parse error suggestions verbose and fix spans) - rust-lang#127684 (consolidate miri-unleashed tests for mutable refs into one file) - rust-lang#127729 (Stop using the `gen` identifier in the compiler) - rust-lang#127736 (Add myself to the review rotation) - rust-lang#127758 (coverage: Restrict `ExpressionUsed` simplification to `Code` mappings) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#127729 - compiler-errors:ed-2024-gen, r=oli-obk Stop using the `gen` identifier in the compiler In preparation for edition 2024, this PR previews the fallout of removing usages of `gen` since it's being reserved as a keyword. There are two notable changes here: 1. Had to rename `fn gen(..)` in gen/kill analysis to `gen_`. Not certain there's a better name than that. 2. There are (false?[^1]) positives in `rustc_macros` when using synstructure, which uses `gen impl` to mark an implementation. We could suppress this in a one-off way, or perhaps just ignore `gen` in macros altogether, since if an identifier ends up in expanded code then it'll get properly denied anyways. Not relevant to the compiler, but it's gonna be really annoying to change `rand`'s `gen` fn in the library and miri... [^1]: I haven't looked at the synstructure proc macro code itself so I'm not certain if it'll start to fail when converted to ed2024 (or, e.g., when syn starts parsing `gen` as a kw).
In preparation for edition 2024, this PR previews the fallout of removing usages of
gen
since it's being reserved as a keyword.There are two notable changes here:
fn gen(..)
in gen/kill analysis togen_
. Not certain there's a better name than that.rustc_macros
when using synstructure, which usesgen impl
to mark an implementation. We could suppress this in a one-off way, or perhaps just ignoregen
in macros altogether, since if an identifier ends up in expanded code then it'll get properly denied anyways.Not relevant to the compiler, but it's gonna be really annoying to change
rand
'sgen
fn in the library and miri...Footnotes
I haven't looked at the synstructure proc macro code itself so I'm not certain if it'll start to fail when converted to ed2024 (or, e.g., when syn starts parsing
gen
as a kw). ↩