-
Notifications
You must be signed in to change notification settings - Fork 1k
Formatting float ranges may result in invalid code #6869
Copy link
Copy link
Open
Labels
A-matchesArea: match arms, patterns, blocks, etcArea: match arms, patterns, blocks, etcC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEF-impacts-stable-default-formatExpected formatting impact: affects stable default format configuration (caution)Expected formatting impact: affects stable default format configuration (caution)I-invalid-codeIssue: formatting causes compile-pass code to compile-failIssue: formatting causes compile-pass code to compile-failS-has-mcveStatus: a Minimal Complete and Verifiable Example has been found for this issueStatus: a Minimal Complete and Verifiable Example has been found for this issue
Metadata
Metadata
Assignees
Labels
A-matchesArea: match arms, patterns, blocks, etcArea: match arms, patterns, blocks, etcC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEF-impacts-stable-default-formatExpected formatting impact: affects stable default format configuration (caution)Expected formatting impact: affects stable default format configuration (caution)I-invalid-codeIssue: formatting causes compile-pass code to compile-failIssue: formatting causes compile-pass code to compile-failS-has-mcveStatus: a Minimal Complete and Verifiable Example has been found for this issueStatus: a Minimal Complete and Verifiable Example has been found for this issue
Type
Fields
Give feedbackNo fields configured for issues without a type.
Formatting float ranges with lower bound specified without decimal part leads to invalid Rust code.
Summary
I tried to format this code:
Expected behavior
Nothing to happen, since the code is already formatted correctly.
Actual behavior
rustfmt formatted
1. ..as1....Configuration
Just default options.
Reproduction Steps
Just format the code.
Meta
rustfmt --version: