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

Change how edition based future compatibility warnings are handled #86330

Merged
merged 6 commits into from
Jun 25, 2021

Conversation

rylev
Copy link
Member

@rylev rylev commented Jun 15, 2021

This fixes #85894 by updating how future compatibility lints work. This makes it more apparent that future compatibility warnings can happen for several different reasons.

For now FutureCompatibilityReasons are limited to three reasons, but we can easily add more.

This also updates the generated warning for FCW's that signal code that will error in a future edition. This makes the diagnostics between FCWs at edition boundaries more distinct from those not happening at an edition boundary.

r? @m-ou-se

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 15, 2021
compiler/rustc_lint/src/array_into_iter.rs Outdated Show resolved Hide resolved
compiler/rustc_middle/src/lint.rs Outdated Show resolved Hide resolved
compiler/rustc_lint_defs/src/lib.rs Outdated Show resolved Hide resolved
compiler/rustc_lint_defs/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@m-ou-se m-ou-se left a comment

Choose a reason for hiding this comment

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

Nice! This looks good to me.

But since I'm not on the compiler team or compiler-contributors, I'll leave the final approval to someone who is:

r? @estebank

@m-ou-se m-ou-se assigned estebank and unassigned m-ou-se Jun 17, 2021
@m-ou-se m-ou-se added A-diagnostics Area: Messages for errors, warnings, and lints D-edition Diagnostics: An error or lint that should account for edition differences. 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 17, 2021
@rylev rylev 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 Jun 17, 2021
@m-ou-se
Copy link
Member

m-ou-se commented Jun 21, 2021

r? @nikomatsakis

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jun 23, 2021

📌 Commit 44d86a9e1d7515b3858b0939a686dd4034d3ecb2 has been approved by nikomatsakis

@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-review Status: Awaiting review from the assignee but also interested parties. labels Jun 23, 2021
@m-ou-se
Copy link
Member

m-ou-se commented Jun 24, 2021

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Jun 24, 2021

📌 Commit e7adb02 has been approved by nikomatsakis

m-ou-se added a commit to m-ou-se/rust that referenced this pull request Jun 24, 2021
…tsakis

Change how edition based future compatibility warnings are handled

This fixes rust-lang#85894 by updating how future compatibility lints work. This makes it more apparent that future compatibility warnings can happen for several different reasons.

For now `FutureCompatibilityReasons` are limited to three reasons, but we can easily add more.

This also updates the generated warning for FCW's that signal code that will error in a future edition. This makes the diagnostics between FCWs at edition boundaries more distinct from those not happening at an edition boundary.

r? `@m-ou-se`
@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 24, 2021
@bors
Copy link
Contributor

bors commented Jun 25, 2021

☔ The latest upstream changes (presumably #86574) made this pull request unmergeable. Please resolve the merge conflicts.

@rylev
Copy link
Member Author

rylev commented Jun 25, 2021

@JohnTitor I've addressed the clippy test. This should be ready for bors again.

@JohnTitor
Copy link
Member

Thanks!
@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Jun 25, 2021

📌 Commit 51f223e has been approved by nikomatsakis

@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 Jun 25, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jun 25, 2021
…tsakis

Change how edition based future compatibility warnings are handled

This fixes rust-lang#85894 by updating how future compatibility lints work. This makes it more apparent that future compatibility warnings can happen for several different reasons.

For now `FutureCompatibilityReasons` are limited to three reasons, but we can easily add more.

This also updates the generated warning for FCW's that signal code that will error in a future edition. This makes the diagnostics between FCWs at edition boundaries more distinct from those not happening at an edition boundary.

r? `@m-ou-se`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 25, 2021
Rollup of 5 pull requests

Successful merges:

 - rust-lang#86330 (Change how edition based future compatibility warnings are handled)
 - rust-lang#86513 (Rustdoc: Do not list impl when trait has doc(hidden))
 - rust-lang#86592 (Use `#[non_exhaustive]` where appropriate)
 - rust-lang#86608 (chore(rustdoc): remove unused members of RenderType)
 - rust-lang#86624 (Update compiler-builtins)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e01a720 into rust-lang:master Jun 25, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jun 25, 2021
bors added a commit to rust-lang/cargo that referenced this pull request Jun 29, 2021
Temporarily disable future_incompat tests.

The `array_into_iter` lint is no longer future-breaking (via rust-lang/rust#86330), so these tests won't work anymore.  This disables the tests until rust-lang/rust#86478 is merged to provide a way to start testing again.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 30, 2021
…omatsakis

Only include lint in future_incompatible lint group if not an edition lint

A follow up to rust-lang#86330 - this only includes lints annotated with `FutureIncompatibleInfo` in the `future_incompatibile` lint group if the future compatibility is not tied to an edition.

We probably want to rename `FutureIncompatibleInfo` to something else since this type is now used to indicate future breakages of all kinds (even those that happen in editions). I'd prefer to do that in a separate PR though.

r? `@nikomatsakis`
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jul 15, 2021
Add -Zfuture-incompat-test to assist with testing future-incompat reports.

This adds a `-Zfuture-incompat-test` cli flag to assist with testing future-incompatible reports. This flag causes all lints to be treated as a future-incompatible lint, and will emit a report for them. This is being added so that Cargo's testsuite can reliably test the reporting infrastructure.  Right now, Cargo relies on using array_into_iter as a test subject. Since the breaking "future incompatible" lints are never intended to last forever, this means Cargo's testsuite would always need to keep changing to choose different lints (for example, rust-lang#86330 proposed dropping that moniker for array_into_iter). With this flag, Cargo's tests can trigger any lint and check for the report.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jul 15, 2021
Add -Zfuture-incompat-test to assist with testing future-incompat reports.

This adds a `-Zfuture-incompat-test` cli flag to assist with testing future-incompatible reports. This flag causes all lints to be treated as a future-incompatible lint, and will emit a report for them. This is being added so that Cargo's testsuite can reliably test the reporting infrastructure.  Right now, Cargo relies on using array_into_iter as a test subject. Since the breaking "future incompatible" lints are never intended to last forever, this means Cargo's testsuite would always need to keep changing to choose different lints (for example, rust-lang#86330 proposed dropping that moniker for array_into_iter). With this flag, Cargo's tests can trigger any lint and check for the report.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jul 15, 2021
Add -Zfuture-incompat-test to assist with testing future-incompat reports.

This adds a `-Zfuture-incompat-test` cli flag to assist with testing future-incompatible reports. This flag causes all lints to be treated as a future-incompatible lint, and will emit a report for them. This is being added so that Cargo's testsuite can reliably test the reporting infrastructure.  Right now, Cargo relies on using array_into_iter as a test subject. Since the breaking "future incompatible" lints are never intended to last forever, this means Cargo's testsuite would always need to keep changing to choose different lints (for example, rust-lang#86330 proposed dropping that moniker for array_into_iter). With this flag, Cargo's tests can trigger any lint and check for the report.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-edition Diagnostics: An error or lint that should account for edition differences. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create group containing all Rust 2021 edition lints
9 participants