edition-guide icon indicating copy to clipboard operation
edition-guide copied to clipboard

Tracking issue for `cargo fix --edition-idioms`

Open carols10cents opened this issue 5 years ago • 3 comments

https://github.com/rust-lang-nursery/edition-guide/blame/5f3cc2a5618700efcde3bc00799744f21fa9ad2e/src/editions/transitioning-an-existing-project-to-a-new-edition.md#L95-L106 says:

Eventually, we want cargo fix to fix all these idioms automatically in the same manner we did for upgrading to the 2018 edition. Currently, though, the "idiom lints" are not ready for widespread automatic fixing. The compiler isn't making cargo fix-compatible suggestions in many cases right now, and it is making incorrect suggestions in others. Enabling the idiom lints, even with cargo fix, is likely to leave your crate either broken or with many warnings still remaining.

We have plans to make these idiom migrations a seamless part of the Rust 2018 experience, but we're not there yet. As a result the following instructions are recommended only for the intrepid who are willing to work through a few compiler/Cargo bugs!

Further down in the same file, https://github.com/rust-lang-nursery/edition-guide/blame/5f3cc2a5618700efcde3bc00799744f21fa9ad2e/src/editions/transitioning-an-existing-project-to-a-new-edition.md#L128-L129

As mentioned before, there are known bugs around the idiom lints which means they're not all ready for prime time yet.

Is this still the case? If so, what is blocking us from recommending that people run cargo fix --edition-idioms? That is, are there specific open issues that could be tracked here as blockers to removing these paragraphs?

carols10cents avatar Jun 13 '19 19:06 carols10cents

The tracking issue is https://github.com/rust-lang/rust/issues/54910. It lists all the corresponding issues blocking it. unused_extern_crates is particularly error-prone.

ehuss avatar Jun 13 '19 20:06 ehuss

Awesome, thanks!

Found another spot related to extern crates-- this should also be updated when cargo fix handles that:

https://github.com/rust-lang-nursery/edition-guide/blame/master/src/rust-2018/module-system/path-clarity.md#L62-L63

carols10cents avatar Jun 13 '19 22:06 carols10cents

This section has moved in #232 to https://github.com/rust-lang/edition-guide/blob/302a115e8f71876dfc884aebb0ca5ccb02b8a962/src/editions/transitioning-an-existing-project-to-a-new-edition.md#writing-idiomatic-code-in-a-new-edition. I think there is still some indecision for 2021, which likely won't have any idiom lints.

ehuss avatar May 25 '21 05:05 ehuss