Rust: Tracking issue for warning for rust_2018_idioms by default

Created on 8 Oct 2018  路  9Comments  路  Source: rust-lang/rust

#[warn(rust_2018_idioms)] is not going to be enabled by default for Rust 2018 because we are taking a conservative stance and we aren't sure about how good the suggestions are yet.

The plan is to enable this lint by default some number of releases / months after Rust 2018 ships.

Progress

  • [x] bare_trait_objects is now set to warn (https://github.com/rust-lang/rust/pull/61203)
  • [x] ellipsis_inclusive_range_patterns will soon be set to warn (https://github.com/rust-lang/rust/pull/61342)
  • [ ] unused_extern_crates has open issues
  • [ ] elided_lifetimes_in_paths has open issues (https://github.com/rust-lang/rust/issues/60199, https://github.com/rust-lang/rust/issues/55768)

This summary was last updated from this comment; check to see if there are new comments since then.

/cc @Centril @aturon @Mark-Simulacrum

A-edition-2018-lints C-tracking-issue WG-epoch

Most helpful comment

Update:

To-do:

If anyone has an interest in helping these lints be enabled, e.g. by tackling any of those potentially blocking diagnostic message issues, go for it!

All 9 comments

Is there an update on this? I'd like to see at least some of the new currently allow-by-default lints to become warn-by-default. Personally I'm missing elided_lifetime_in_path the most, because these kinds of elided lifetimes regularly lead to hard to spot bugs.

@oberien you could modify your environment variables and add

RUSTFLAGS="$RUSTFLAGS -W rust_2018_idioms"

and you have it enabled for all your projects on your local machine.

It would be great to have bare_trait_objects set to warn by default. I often see users in chats accidentally use trait objects when they did not intend to.

After setting bare_trait_objects to warn and running --bless on the tests, 300+ ui stderr files changed due to the warnings (expected after seeing the output from the previous PR ).

If there is still interest to see a crater run with deny set, I think it's possible to run crater without CI tests passing as long as if the build succeeds.

If we continued with warn, we could change many of the tests to use dyn, avoiding committing too much stderr noise. Some tests would be left bare to continue testing the ui of the lint. What do you think?

@memoryruins Feel free to send in a PR for warnings and I'll FCP that one. We can crank up to deny later.

Update:

To-do:

If anyone has an interest in helping these lints be enabled, e.g. by tackling any of those potentially blocking diagnostic message issues, go for it!

55768 also impacts (the rustfixability of) elided_lifetimes_in_paths.

71957 is another open issue for elided_lifetimes_in_paths, although to my (very limited) knowledge it shouldn't affect making the lint warn-by-default.

Was this page helpful?
0 / 5 - 0 ratings