Support pretty printing of invalid constants#94020
Conversation
|
Some changes occured to the CTFE / Miri engine cc @rust-lang/miri |
|
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
|
@bors r+ rollup |
|
📌 Commit a8bc3b3c353b479f8063f41bb620e3611a3e2fa3 has been approved by |
|
📌 Commit ae5c039c11ca544f331202d847fc55ab4a587a02 has been approved by |
…askrgr Rollup of 5 pull requests Successful merges: - rust-lang#93899 (Describe VecDeque with more consistent names) - rust-lang#93949 (Add basic platform support to library/{panic_}unwind for m68k) - rust-lang#93999 (suggest using raw strings when invalid escapes appear in literals) - rust-lang#94001 (llvm: migrate to new parameter-bearing uwtable attr) - rust-lang#94014 (Move transmute_undefined_repr back to nursery) Failed merges: - rust-lang#94020 (Support pretty printing of invalid constants) r? `@ghost` `@rustbot` modify labels: rollup
There was a problem hiding this comment.
That's just the optimization changing the mir. This is a diff of a diff
There was a problem hiding this comment.
const ConstValue seems somewhat redundant, if we always have that const prefix maybe we should make this just const Scalar(0x02): Option::<()>? Or maybe also somehow indicate that this value is invalid and a "fallback" printing was used?
There was a problem hiding this comment.
Dropped ConstValue part, matching the following fall back format instead of the preceding verbose one.
|
@bors r- the output could be adjusted a bit |
Make it possible to pretty print invalid constants by introducing a fallible variant of `destructure_const` and falling back to debug formatting when it fails.
|
@bors r+ |
|
📌 Commit 92d20c4 has been approved by |
Support pretty printing of invalid constants Make it possible to pretty print invalid constants by introducing a fallible variant of `destructure_const` and falling back to debug formatting when it fails. Closes rust-lang#93688.
…askrgr Rollup of 10 pull requests Successful merges: - rust-lang#92366 (Resolve concern of `derive_default_enum`) - rust-lang#93382 (Add a bit more padding in search box) - rust-lang#93962 (Make [u8]::cmp implementation branchless) - rust-lang#94015 (rustdoc --check option documentation) - rust-lang#94017 (Clarify confusing UB statement in MIR) - rust-lang#94020 (Support pretty printing of invalid constants) - rust-lang#94027 (Update browser UI test version) - rust-lang#94037 (Fix inconsistent symbol mangling with -Zverbose) - rust-lang#94045 (Update books) - rust-lang#94054 (:arrow_up: rust-analyzer) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Make it possible to pretty print invalid constants by introducing a
fallible variant of
destructure_constand falling back to debugformatting when it fails.
Closes #93688.