about summary refs log tree commit diff
path: root/compiler/rustc_middle
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-08-10 09:28:24 -0700
committerGitHub <noreply@github.com>2022-08-10 09:28:24 -0700
commit96fc9f177e37f560787e37b8fee4e1dd772b6bfa (patch)
tree3b83176d382bfb3fca5dca109622f8d2074d032d /compiler/rustc_middle
parentefa182f3db46b70841dc4481b112cb365b52921a (diff)
parent4bf350dc388792fe859580ad92b422f701573616 (diff)
downloadrust-96fc9f177e37f560787e37b8fee4e1dd772b6bfa.tar.gz
rust-96fc9f177e37f560787e37b8fee4e1dd772b6bfa.zip
Rollup merge of #100359 - b-naber:valtrees-pretty-print-ice, r=lcnr
Special-case references to leafs in valtree pretty-printing

Fixes https://github.com/rust-lang/rust/issues/100313
Diffstat (limited to 'compiler/rustc_middle')
-rw-r--r--compiler/rustc_middle/src/ty/print/pretty.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs
index 7f2e81a71a9..cc55b7e8611 100644
--- a/compiler/rustc_middle/src/ty/print/pretty.rs
+++ b/compiler/rustc_middle/src/ty/print/pretty.rs
@@ -1513,6 +1513,10 @@ pub trait PrettyPrinter<'tcx>:
                 }
                 return Ok(self);
             }
+            (ty::ValTree::Leaf(leaf), ty::Ref(_, inner_ty, _)) => {
+                p!(write("&"));
+                return self.pretty_print_const_scalar_int(leaf, *inner_ty, print_ty);
+            }
             (ty::ValTree::Leaf(leaf), _) => {
                 return self.pretty_print_const_scalar_int(leaf, ty, print_ty);
             }