From 80dcc529347c20b4679b20b170689e3c593a96b2 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Fri, 2 Dec 2022 15:43:08 +0000 Subject: [PATCH] Remove an impl and replace its only use with a method call --- compiler/rustc_middle/src/mir/mod.rs | 6 ------ compiler/rustc_mir_transform/src/pass_manager.rs | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index 08cce3d76832..599784d22df4 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -178,12 +178,6 @@ impl RuntimePhase { } } -impl Display for MirPhase { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - f.write_str(self.name()) - } -} - /// Where a specific `mir::Body` comes from. #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[derive(HashStable, TyEncodable, TyDecodable, TypeFoldable, TypeVisitable)] diff --git a/compiler/rustc_mir_transform/src/pass_manager.rs b/compiler/rustc_mir_transform/src/pass_manager.rs index 6288d006e947..c7a420562880 100644 --- a/compiler/rustc_mir_transform/src/pass_manager.rs +++ b/compiler/rustc_mir_transform/src/pass_manager.rs @@ -143,7 +143,7 @@ fn run_passes_inner<'tcx>( dump_mir_for_phase_change(tcx, body); if validate || new_phase == MirPhase::Runtime(RuntimePhase::Optimized) { - validate_body(tcx, body, format!("after phase change to {}", new_phase)); + validate_body(tcx, body, format!("after phase change to {}", new_phase.name())); } body.pass_count = 1;