Rustfmt: Unstable feature warnings are printed multiple times

Created on 18 Oct 2019  路  2Comments  路  Source: rust-lang/rustfmt

When I run cargo fmt on stable the warnings about unstable features seem to be printed multiple times, one for each file that is being linted.

Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_strings = true`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = true`, unstable features are only available in nightly channel.
Warning: can't set `reorder_impl_items = true`, unstable features are only available in nightly channel.
Warning: can't set `condense_wildcard_suffixes = true`, unstable features are only available in nightly channel.
Warning: can't set `unstable_features = true`, unstable features are only available in nightly channel.
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_strings = true`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = true`, unstable features are only available in nightly channel.
Warning: can't set `reorder_impl_items = true`, unstable features are only available in nightly channel.
...
bug

Most helpful comment

We should handle these kinds of errors and warnings more deliberately. In this particular case, instead of eprintln!-ing each warning, we should store them to a map and emit them afterward.

All 2 comments

Do you have multiple rustfmt config files by any chance?

We should handle these kinds of errors and warnings more deliberately. In this particular case, instead of eprintln!-ing each warning, we should store them to a map and emit them afterward.

Was this page helpful?
0 / 5 - 0 ratings