@@ -112,43 +112,39 @@ impl<'tcx> chalk_ir::interner::Interner for RustInterner<'tcx> {
112
112
match application_ty. name {
113
113
chalk_ir:: TypeName :: Ref ( mutbl) => {
114
114
let data = application_ty. substitution . interned ( ) ;
115
- let lifetime = match & * * data[ 0 ] . interned ( ) {
116
- chalk_ir:: GenericArgData :: Lifetime ( t) => t,
115
+ match ( & * * data[ 0 ] . interned ( ) , & * * data[ 1 ] . interned ( ) ) {
116
+ (
117
+ chalk_ir:: GenericArgData :: Lifetime ( lifetime) ,
118
+ chalk_ir:: GenericArgData :: Ty ( ty) ,
119
+ ) => Some ( match mutbl {
120
+ chalk_ir:: Mutability :: Not => write ! ( fmt, "(&{:?} {:?})" , lifetime, ty) ,
121
+ chalk_ir:: Mutability :: Mut => write ! ( fmt, "(&{:?} mut {:?})" , lifetime, ty) ,
122
+ } ) ,
117
123
_ => unreachable ! ( ) ,
118
- } ;
119
- let ty = match & * * data[ 1 ] . interned ( ) {
120
- chalk_ir:: GenericArgData :: Ty ( t) => t,
121
- _ => unreachable ! ( ) ,
122
- } ;
123
- return Some ( match mutbl {
124
- chalk_ir:: Mutability :: Not => write ! ( fmt, "(&{:?} {:?})" , lifetime, ty) ,
125
- chalk_ir:: Mutability :: Mut => write ! ( fmt, "(&{:?} mut {:?})" , lifetime, ty) ,
126
- } ) ;
124
+ }
127
125
}
128
126
chalk_ir:: TypeName :: Array => {
129
127
let data = application_ty. substitution . interned ( ) ;
130
- let ty = match & * * data[ 0 ] . interned ( ) {
131
- chalk_ir:: GenericArgData :: Ty ( t) => t,
132
- _ => unreachable ! ( ) ,
133
- } ;
134
- let len = match & * * data[ 1 ] . interned ( ) {
135
- chalk_ir:: GenericArgData :: Const ( t) => t,
128
+ match ( & * * data[ 0 ] . interned ( ) , & * * data[ 1 ] . interned ( ) ) {
129
+ ( chalk_ir:: GenericArgData :: Ty ( ty) , chalk_ir:: GenericArgData :: Const ( len) ) => {
130
+ Some ( write ! ( fmt, "[{:?}; {:?}]" , ty, len) )
131
+ }
136
132
_ => unreachable ! ( ) ,
137
- } ;
138
- return Some ( write ! ( fmt, "[{:?}; {:?}]" , ty, len) ) ;
133
+ }
139
134
}
140
135
chalk_ir:: TypeName :: Slice => {
141
136
let data = application_ty. substitution . interned ( ) ;
142
137
let ty = match & * * data[ 0 ] . interned ( ) {
143
138
chalk_ir:: GenericArgData :: Ty ( t) => t,
144
139
_ => unreachable ! ( ) ,
145
140
} ;
146
- return Some ( write ! ( fmt, "[{:?}]" , ty) ) ;
141
+ Some ( write ! ( fmt, "[{:?}]" , ty) )
142
+ }
143
+ _ => {
144
+ let chalk_ir:: ApplicationTy { name, substitution } = application_ty;
145
+ Some ( write ! ( fmt, "{:?}{:?}" , name, chalk_ir:: debug:: Angle ( substitution. interned( ) ) ) )
147
146
}
148
- _ => { }
149
147
}
150
- let chalk_ir:: ApplicationTy { name, substitution } = application_ty;
151
- Some ( write ! ( fmt, "{:?}{:?}" , name, chalk_ir:: debug:: Angle ( substitution. interned( ) ) ) )
152
148
}
153
149
154
150
fn debug_substitution (
0 commit comments