--print-config current with use_small_heuristics = "Off": Could not output config: out-of-range value for u64 type
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
I'm attempting to detect whether a project has unstable rustfmt features configured, and was hoping to use rustfmt to detect that. However, with a config file like:
edition = "2021"
condense_wildcard_suffixes = true
error_on_line_overflow = true
format_code_in_doc_comments = true
format_macro_bodies = true
format_macro_matchers = true
format_strings = true
group_imports = "StdExternalCrate"
hex_literal_case = "Upper"
imports_granularity = "Crate"
max_width = 80
newline_style = "Unix"
reorder_impl_items = true
use_field_init_shorthand = true
use_small_heuristics = "Off"
use_try_shorthand = true
wrap_comments = true
running the following only prints an error:
:; rustfmt +nightly --print-config current main.rs
Could not output config: out-of-range value for u64 type
I would expect that config file to re-serialize correctly, as the formatter does do the work according to the config.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with rustfmt +nightly --print-config current main.rs and the shown configuration, focusing on use_small_heuristics = "Off". Trace the --print-config entry point and its config serialization path. Done means the command outputs the configuration without the out-of-range u64 error and preserves the configured value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100