Skip to content

test: Fix printing bitwise float reprs in error printing#1205

Merged
tgross35 merged 1 commit intorust-lang:mainfrom
tgross35:fix-test-print
Apr 19, 2026
Merged

test: Fix printing bitwise float reprs in error printing#1205
tgross35 merged 1 commit intorust-lang:mainfrom
tgross35:fix-test-print

Conversation

@tgross35
Copy link
Copy Markdown
Contributor

In commit "test: Consolidate Hexf, Hexi, and the Hex trait" we unintentionally lost the difference between float hex and bitwise hex formatting; instead, the float hex was getting printed twice. Resolve this by printing the integer hex whenever the - format modifier is specified. This also makes things simpler because we no longer need to keep track of whether an impl DisplayHex is a float with .to_bits() available or an integer without it, we can always just try to print both forms.

As a result, we can use a common error message for all validation checks.

In commit "test: Consolidate `Hexf`, `Hexi`, and the `Hex` trait" we
unintentionally lost the difference between float hex and bitwise hex
formatting; instead, the float hex was getting printed twice. Resolve
this by printing the integer hex whenever the `-` format modifier is
specified.  This also makes things simpler because we no longer need to
keep track of whether an `impl DisplayHex` is a float with `.to_bits()`
available or an integer without it, we can always just try to print both
forms.

As a result, we can use a common error message for all validation
checks.
@tgross35 tgross35 enabled auto-merge (rebase) April 19, 2026 03:10
@tgross35 tgross35 merged commit 99fdc8a into rust-lang:main Apr 19, 2026
43 checks passed
@tgross35 tgross35 deleted the fix-test-print branch April 19, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant