-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
migration lint for expr2024
for the edition 2024
#125627
migration lint for expr2024
for the edition 2024
#125627
Conversation
rustbot has assigned @michaelwoerister. Use |
2ce0627
to
962a9a1
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
compiler/rustc_lint/src/macro_expr_fragment_specifier_2024_migration.rs
Outdated
Show resolved
Hide resolved
r? @traviscross |
compiler/rustc_lint/src/macro_expr_fragment_specifier_2024_migration.rs
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
2de8f59
to
515f271
Compare
This comment has been minimized.
This comment has been minimized.
r? @eholk |
This comment has been minimized.
This comment has been minimized.
d11c856
to
664aefe
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be in a pretty decent shape, but I left a few comments.
compiler/rustc_lint/src/macro_expr_fragment_specifier_2024_migration.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_lint/src/macro_expr_fragment_specifier_2024_migration.rs
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
728e8e0
to
d688d7d
Compare
/// ### Explanation | ||
/// | ||
/// Rust [editions] allow the language to evolve without breaking | ||
/// backwards compatibility. This lint catches code that uses new keywords | ||
/// that are added to the language that are used as identifiers (such as a | ||
/// variable name, function name, etc.). If you switch the compiler to a | ||
/// new edition without updating the code, then it will fail to compile if | ||
/// you are using a new keyword as an identifier. | ||
/// | ||
/// This lint solves the problem automatically. It is "allow" by default | ||
/// because the code is perfectly valid in older editions. The [`cargo | ||
/// fix`] tool with the `--edition` flag will switch this lint to "warn" | ||
/// and automatically apply the suggested fix from the compiler. | ||
/// This provides a completely automated way to update old code for | ||
/// a new edition. | ||
/// | ||
/// [editions]: https://doc.rust-lang.org/edition-guide/ | ||
/// [`cargo fix`]: https://doc.rust-lang.org/cargo/commands/cargo-fix.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs further changes, e.g. to explain what this lint does and what people should know about it (e.g. that they probably want to switch back to expr
from expr_2021
), and to remove text from the explanation that is not correct for what this lint does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@traviscross we update the docs with @eholk so should be good for another review
Ah, it looks like such a tests exists: https://github.com/rust-lang/rust/pull/125627/files#diff-af322a90f8768b5f39a55aa9cbdce92b80b502f4e8b5d84c0959e93d73ddc7d4 Carry on. |
This comment has been minimized.
This comment has been minimized.
1ee9ad2
to
1827af9
Compare
This is adding a migration lint for the current (in the 2021 edition and previous) to move expr to expr_2021 from expr Co-Developed-by: Eric Holk Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Co-Developed-by: Eric Holk Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
1827af9
to
568e78f
Compare
@compiler-errors When you have time I would like to have another review on the parsing code to see if the code can have your bless 😸 |
This looks fine to me for now. Please rebase to squash that |
Concurrency problem, I did while you was writing the comment sorry 😸 |
@bors r=compiler-errors,eholk rollup |
…xpr2024, r=compiler-errors,eholk migration lint for `expr2024` for the edition 2024 This is adding a migration lint for the current (in the 2021 edition and previous) to move expr to expr_2021 from expr Issue rust-lang#123742 I created also a repository to test out the migration https://github.com/vincenzopalazzo/expr2024-cargo-fix-migration Co-Developed-by: `@eholk`
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#124339 (allow overwriting the output of `rustc --version`) - rust-lang#125627 (migration lint for `expr2024` for the edition 2024) - rust-lang#127091 (impl FusedIterator and a size hint for the error sources iter) - rust-lang#127358 (Automatically taint when reporting errors from ItemCtxt) - rust-lang#127484 (`#[doc(alias)]`'s doc: say that ASCII spaces are allowed) - rust-lang#127495 (More trait error reworking) - rust-lang#127496 (Update `f16`/`f128` FIXMEs that needed `(NEG_)INFINITY`) - rust-lang#127508 (small search graph refactor) - rust-lang#127521 (Remove spastorino from SMIR) - rust-lang#127532 (documentation: update cmake version) r? `@ghost` `@rustbot` modify labels: rollup
…xpr2024, r=compiler-errors,eholk migration lint for `expr2024` for the edition 2024 This is adding a migration lint for the current (in the 2021 edition and previous) to move expr to expr_2021 from expr Issue rust-lang#123742 I created also a repository to test out the migration https://github.com/vincenzopalazzo/expr2024-cargo-fix-migration Co-Developed-by: ```@eholk```
Rollup of 8 pull requests Successful merges: - rust-lang#124211 (Bump `elided_lifetimes_in_associated_constant` to deny) - rust-lang#125627 (migration lint for `expr2024` for the edition 2024) - rust-lang#127091 (impl FusedIterator and a size hint for the error sources iter) - rust-lang#127461 (Fixup failing fuchsia tests) - rust-lang#127484 (`#[doc(alias)]`'s doc: say that ASCII spaces are allowed) - rust-lang#127508 (small search graph refactor) - rust-lang#127521 (Remove spastorino from SMIR) - rust-lang#127532 (documentation: update cmake version) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#125627 - vincenzopalazzo:macros/cargo-fix-expr2024, r=compiler-errors,eholk migration lint for `expr2024` for the edition 2024 This is adding a migration lint for the current (in the 2021 edition and previous) to move expr to expr_2021 from expr Issue rust-lang#123742 I created also a repository to test out the migration https://github.com/vincenzopalazzo/expr2024-cargo-fix-migration Co-Developed-by: ``@eholk``
This is adding a migration lint for the current (in the 2021 edition and previous)
to move expr to expr_2021 from expr
Issue #123742
I created also a repository to test out the migration https://github.com/vincenzopalazzo/expr2024-cargo-fix-migration
Co-Developed-by: @eholk