Skip to content
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

Merged
merged 1 commit into from
Jul 28, 2024

Conversation

Noratrieb
Copy link
Member

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 #121042

r? compiler-errors as the method prober

@Noratrieb Noratrieb added the A-edition-2024 Area: The 2024 edition label Jun 2, 2024
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 2, 2024
@rust-log-analyzer

This comment has been minimized.

Comment on lines +3875 to +3791
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>",
};
Copy link
Contributor

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:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, added it

@compiler-errors
Copy link
Member

@rustbot author

needs some tweaks, not totally certain if i care if we check for Future trait being impl'd or not 🤷 would like to see the code in its final state tho

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 4, 2024
@Noratrieb
Copy link
Member Author

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.

@rust-log-analyzer

This comment has been minimized.

@Noratrieb
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 7, 2024
Copy link
Member

@compiler-errors compiler-errors left a 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?

@compiler-errors
Copy link
Member

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 9, 2024
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.
@Noratrieb
Copy link
Member Author

removed the lang item and addresses the rest of the previous feedback: https://github.com/rust-lang/rust/compare/33c3482dac622acb0627ab096ccc633f3f7b21e2..6f662176e7cc5ff81642ca243f50c6b7ed86b8f8
@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Jul 28, 2024

📌 Commit 6f66217 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 28, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 28, 2024
…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
@bors bors merged commit cc17ca2 into rust-lang:master Jul 28, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Jul 28, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 28, 2024
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
@Noratrieb Noratrieb deleted the migrate-into-the-future branch July 28, 2024 18:11
@Noratrieb Noratrieb restored the migrate-into-the-future branch July 28, 2024 18:11
@Noratrieb Noratrieb deleted the migrate-into-the-future branch July 28, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2024 Area: The 2024 edition S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants