@@ -721,7 +721,6 @@ impl<'tcx> Debug for Rvalue<'tcx> {
721
721
match * self {
722
722
Use ( ref lvalue) => write ! ( fmt, "{:?}" , lvalue) ,
723
723
Repeat ( ref a, ref b) => write ! ( fmt, "[{:?}; {:?}]" , a, b) ,
724
- Ref ( ref a, bk, ref b) => write ! ( fmt, "&{:?} {:?} {:?}" , a, bk, b) ,
725
724
Len ( ref a) => write ! ( fmt, "Len({:?})" , a) ,
726
725
Cast ( ref kind, ref lv, ref ty) => write ! ( fmt, "{:?} as {:?} ({:?})" , lv, ty, kind) ,
727
726
BinaryOp ( ref op, ref a, ref b) => write ! ( fmt, "{:?}({:?}, {:?})" , op, a, b) ,
@@ -731,6 +730,14 @@ impl<'tcx> Debug for Rvalue<'tcx> {
731
730
Slice { ref input, from_start, from_end } =>
732
731
write ! ( fmt, "{:?}[{:?}..-{:?}]" , input, from_start, from_end) ,
733
732
733
+ Ref ( _, borrow_kind, ref lv) => {
734
+ let kind_str = match borrow_kind {
735
+ BorrowKind :: Shared => "" ,
736
+ BorrowKind :: Mut | BorrowKind :: Unique => "mut " ,
737
+ } ;
738
+ write ! ( fmt, "&{}{:?}" , kind_str, lv)
739
+ }
740
+
734
741
Aggregate ( ref kind, ref lvs) => {
735
742
use self :: AggregateKind :: * ;
736
743
0 commit comments