File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
compiler/stable_mir/src/mir Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,6 @@ pub fn pretty_rvalue(rval: &Rvalue) -> String {
171171
172172pub fn pretty_ty ( ty : TyKind ) -> String {
173173 let mut pretty = String :: new ( ) ;
174- pretty. push_str ( "" ) ;
175174 match ty {
176175 TyKind :: RigidTy ( rigid_ty) => match rigid_ty {
177176 RigidTy :: Bool => "bool" . to_string ( ) ,
@@ -215,7 +214,10 @@ pub fn pretty_ty(ty: TyKind) -> String {
215214 pretty. push_str ( & pretty_ty ( ty. kind ( ) ) ) ;
216215 pretty
217216 }
218- RigidTy :: Ref ( _, ty, _) => pretty_ty ( ty. kind ( ) ) ,
217+ RigidTy :: Ref ( _, ty, mutability) => match mutability {
218+ Mutability :: Not => format ! ( "&{}" , pretty_ty( ty. kind( ) ) ) ,
219+ Mutability :: Mut => format ! ( "&mut {}" , pretty_ty( ty. kind( ) ) ) ,
220+ } ,
219221 RigidTy :: FnDef ( _, _) => format ! ( "{:#?}" , rigid_ty) ,
220222 RigidTy :: FnPtr ( _) => format ! ( "{:#?}" , rigid_ty) ,
221223 RigidTy :: Closure ( _, _) => format ! ( "{:#?}" , rigid_ty) ,
You can’t perform that action at this time.
0 commit comments