File tree 1 file changed +25
-23
lines changed
1 file changed +25
-23
lines changed Original file line number Diff line number Diff line change @@ -2184,29 +2184,7 @@ impl<'tcx> Debug for Place<'tcx> {
2184
2184
} ) ;
2185
2185
2186
2186
self . iterate ( |place_base, place_projections| {
2187
- match place_base {
2188
- PlaceBase :: Local ( id) => {
2189
- write ! ( fmt, "{:?}" , id) ?;
2190
- }
2191
- PlaceBase :: Static ( box self :: Static { ty, kind : StaticKind :: Static ( def_id) } ) => {
2192
- write ! (
2193
- fmt,
2194
- "({}: {:?})" ,
2195
- ty:: tls:: with( |tcx| tcx. def_path_str( * def_id) ) ,
2196
- ty
2197
- ) ?;
2198
- } ,
2199
- PlaceBase :: Static (
2200
- box self :: Static { ty, kind : StaticKind :: Promoted ( promoted) }
2201
- ) => {
2202
- write ! (
2203
- fmt,
2204
- "({:?}: {:?})" ,
2205
- promoted,
2206
- ty
2207
- ) ?;
2208
- } ,
2209
- }
2187
+ write ! ( fmt, "{:?}" , place_base) ?;
2210
2188
2211
2189
for projection in place_projections {
2212
2190
match projection. elem {
@@ -2256,6 +2234,30 @@ impl<'tcx> Debug for Place<'tcx> {
2256
2234
}
2257
2235
}
2258
2236
2237
+ impl Debug for PlaceBase < ' _ > {
2238
+ fn fmt ( & self , fmt : & mut Formatter < ' _ > ) -> fmt:: Result {
2239
+ match * self {
2240
+ PlaceBase :: Local ( id) => write ! ( fmt, "{:?}" , id) ,
2241
+ PlaceBase :: Static ( box self :: Static { ty, kind : StaticKind :: Static ( def_id) } ) => {
2242
+ write ! (
2243
+ fmt,
2244
+ "({}: {:?})" ,
2245
+ ty:: tls:: with( |tcx| tcx. def_path_str( def_id) ) ,
2246
+ ty
2247
+ )
2248
+ } ,
2249
+ PlaceBase :: Static ( box self :: Static { ty, kind : StaticKind :: Promoted ( promoted) } ) => {
2250
+ write ! (
2251
+ fmt,
2252
+ "({:?}: {:?})" ,
2253
+ promoted,
2254
+ ty
2255
+ )
2256
+ } ,
2257
+ }
2258
+ }
2259
+ }
2260
+
2259
2261
///////////////////////////////////////////////////////////////////////////
2260
2262
// Scopes
2261
2263
You can’t perform that action at this time.
0 commit comments