-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Add migration lint for 2024 prelude additions #125889
Conversation
This comment has been minimized.
This comment has been minimized.
26deb13
to
0f46870
Compare
tests/ui/rust-2024/prelude-migration/into-future-not-into-future.rs
Outdated
Show resolved
Hide resolved
pub RUST_2024_PRELUDE_COLLISIONS, | ||
Allow, | ||
"detects the usage of trait methods which are ambiguous with traits added to the \ | ||
prelude in future editions", | ||
@future_incompatible = FutureIncompatibleInfo { | ||
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2024), | ||
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2024/prelude.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.
It'd be good to add a test to demonstrate that this is picked up in the rust_2024_compatibility
lint group, as in:
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.
good idea, added it
@rustbot author needs some tweaks, not totally certain if i care if we check for |
Status here: I want to address the feedback and probably remove the check for the trait impl. I won't get to this for at least another week though, if anyone else wants to pick this up in the meantime, feel free. |
0f46870
to
eca614b
Compare
This comment has been minimized.
This comment has been minimized.
eca614b
to
33c3482
Compare
@rustbot ready |
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.
r=me on the impl, though i think a lang item needs to be removed?
@rustbot author |
This adds the migration lint for the newly ambiguous methods `poll` and `into_future`. When these methods are used on types implementing the respective traits, it will be ambiguous in the future, which can lead to hard errors or behavior changes depending on the exact circumstances.
33c3482
to
6f66217
Compare
removed the lang item and addresses the rest of the previous feedback: https://github.com/rust-lang/rust/compare/33c3482dac622acb0627ab096ccc633f3f7b21e2..6f662176e7cc5ff81642ca243f50c6b7ed86b8f8 |
…iaskrgr Rollup of 3 pull requests Successful merges: - rust-lang#125889 (Add migration lint for 2024 prelude additions) - rust-lang#128215 (Update the reference) - rust-lang#128263 (rustdoc: use strategic ThinVec/Box to shrink `clean::ItemKind`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#125889 - Nilstrieb:migrate-into-the-future, r=compiler-errors Add migration lint for 2024 prelude additions This adds the migration lint for the newly ambiguous methods `poll` and `into_future`. When these methods are used on types implementing the respective traits, it will be ambiguous in the future, which can lead to hard errors or behavior changes depending on the exact circumstances. tracked by rust-lang#121042 <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> r? compiler-errors as the method prober
This adds the migration lint for the newly ambiguous methods
poll
andinto_future
. When these methods are used on types implementing the respective traits, it will be ambiguous in the future, which can lead to hard errors or behavior changes depending on the exact circumstances.tracked by #121042
r? compiler-errors as the method prober