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

Audit deprecation lints and hardcoded warnings and turn most of them into errors in 2018 edition #52593

Closed
petrochenkov opened this issue Jul 21, 2018 · 5 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-edition-2018 Area: The 2018 edition A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. F-rust_2018_preview `#![feature(rust_2018_preview)]` T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@petrochenkov
Copy link
Contributor

Most these are going to become errors in 2015 edition as well sooner or later, but since edition switch is an explicit opt in, it's a good opportunity to tie disabling of all the deprecated stuff to it as well.

The amount of additional required changes will be negligible compared to changes already required for 2018 migration, especially if we are counting "2018 idioms" in.

Additionally, hardcoded warnings are bad, mkay, and audit is also necessary to turn them into configurable lints or errors. (Most of the warnings are very old and predate the deprecation lint system, and fire only in very rare cases.)

How to: add some kind of flag to span_warn and deprecation lint machinery that's false by default and "false" means it's a hard error on 2018 edition. Explicit opt-out can be applied so that a lint/warning continues being a lint/warning even on 2018 edition.

Known lints/warnings requiring opt-out:

@petrochenkov petrochenkov added A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-diagnostics Area: Messages for errors, warnings, and lints F-rust_2018_preview `#![feature(rust_2018_preview)]` labels Jul 21, 2018
@Mark-Simulacrum Mark-Simulacrum added I-nominated T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Jul 31, 2018
@nikomatsakis
Copy link
Contributor

Discussed in the @rust-lang/lang meeting. Some thoughts.

  • Clearly, "future-compatibility warnings" can certainly become hard errors.
    • i.e., things that will become hard errors in 2015.
  • In general, though, I'm a bit reluctant to add a bunch of new errors into the 2015 -> 2018 migration unless they have migration lints.
    • We've generally been trying to make the first edition relatively conservative when it comes to breakage in general -- it might be that future editions are more aggressive once we have the kinks worked out.

Anyway, it'd be good to see the list, is the TL;DR I suppose!

@nikomatsakis
Copy link
Contributor

It seems like the time limit is approaching to make a move here.

@petrochenkov
Copy link
Contributor Author

This is probably not a high priority.
I someone (e.g. me) comes up with a lint audit until RC2, then it would be good, otherwise - not a big deal.

@nikomatsakis
Copy link
Contributor

Bumping to Rust 2018 Release milestone.

@nikomatsakis
Copy link
Contributor

Removing from Rust 2018 release milestone. This might've been nice but I think we just don't have time right now for it, and I don't see us backporting such changes. (@petrochenkov feel free to re-open if you disagree)

@fmease fmease added the A-edition-2018 Area: The 2018 edition label Dec 21, 2024
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 A-edition-2018 Area: The 2018 edition A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. F-rust_2018_preview `#![feature(rust_2018_preview)]` T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants