File tree Expand file tree Collapse file tree 1 file changed +25
-23
lines changed Expand file tree Collapse file tree 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> {
21842184 } ) ;
21852185
21862186 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) ?;
22102188
22112189 for projection in place_projections {
22122190 match projection. elem {
@@ -2256,6 +2234,30 @@ impl<'tcx> Debug for Place<'tcx> {
22562234 }
22572235}
22582236
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+
22592261///////////////////////////////////////////////////////////////////////////
22602262// Scopes
22612263
You can’t perform that action at this time.
0 commit comments