rust-lang / rustfmt

Format Rust code
https://rust-lang.github.io/rustfmt/
Apache License 2.0
6.06k stars 892 forks source link

the `version` option is deprecated -- but which "style_edition" should I set? #6340

Closed RalfJung closed 1 month ago

RalfJung commented 2 months ago

I am now getting warnings like this:

Warning: the `version` option is deprecated. Use `style_edition` instead.

I assume this refers to version = "Two" in my rustfmt.toml. However, how do I find out which value for style_edition this corresponds to?

ytmimi commented 2 months ago

It's mentioned in the changelog. Do you think the warning message should be changed to include that information?

ytmimi commented 2 months ago

We should probably update the configuration docs too:

RalfJung commented 2 months ago

It would be good to include a link with some sort of context in the error, yes. Like an issue tracking the deprecation of this field and giving actionable advice for what to do.

calebcartwright commented 2 months ago

I think we can update the warning text as well with the corresponding specific value of style_edition to use

RalfJung commented 2 months ago

Two is likely the only value version is explicitly set to, so it'd probably suffice to just cover that case.