File tree 1 file changed +4
-2
lines changed
compiler/stable_mir/src/mir
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 {
171
171
172
172
pub fn pretty_ty ( ty : TyKind ) -> String {
173
173
let mut pretty = String :: new ( ) ;
174
- pretty. push_str ( "" ) ;
175
174
match ty {
176
175
TyKind :: RigidTy ( rigid_ty) => match rigid_ty {
177
176
RigidTy :: Bool => "bool" . to_string ( ) ,
@@ -215,7 +214,10 @@ pub fn pretty_ty(ty: TyKind) -> String {
215
214
pretty. push_str ( & pretty_ty ( ty. kind ( ) ) ) ;
216
215
pretty
217
216
}
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
+ } ,
219
221
RigidTy :: FnDef ( _, _) => format ! ( "{:#?}" , rigid_ty) ,
220
222
RigidTy :: FnPtr ( _) => format ! ( "{:#?}" , rigid_ty) ,
221
223
RigidTy :: Closure ( _, _) => format ! ( "{:#?}" , rigid_ty) ,
You can’t perform that action at this time.
0 commit comments