]> git.lizzy.rs Git - rust.git/commit
Support pretty printing of invalid constants
authorTomasz Miąsko <tomasz.miasko@gmail.com>
Tue, 15 Feb 2022 12:58:34 +0000 (13:58 +0100)
committerTomasz Miąsko <tomasz.miasko@gmail.com>
Tue, 15 Feb 2022 23:38:59 +0000 (00:38 +0100)
commit92d20c4aaddea9507f8ad37fe37c551219153bbf
tree12922a3d4bbc15f867ab89b344c994e62ab704da
parentbfb2856f271fcb647b3cad1b88b29ec97bbab2a3
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.
compiler/rustc_const_eval/src/const_eval/mod.rs
compiler/rustc_const_eval/src/lib.rs
compiler/rustc_middle/src/mir/interpret/queries.rs
compiler/rustc_middle/src/query/mod.rs
compiler/rustc_middle/src/ty/print/pretty.rs
src/test/mir-opt/const_prop/invalid_constant.main.ConstProp.diff [new file with mode: 0644]
src/test/mir-opt/const_prop/invalid_constant.rs [new file with mode: 0644]