]> git.lizzy.rs Git - rust.git/commitdiff
Remove an impl and replace its only use with a method call
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Fri, 2 Dec 2022 15:43:08 +0000 (15:43 +0000)
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Fri, 2 Dec 2022 15:43:36 +0000 (15:43 +0000)
compiler/rustc_middle/src/mir/mod.rs
compiler/rustc_mir_transform/src/pass_manager.rs

index 08cce3d76832a7319ce9e138a555ffc7d56715d5..599784d22df49e3972977804b0116e85ee3123f7 100644 (file)
@@ -178,12 +178,6 @@ pub fn parse(phase: Option<String>) -> Self {
     }
 }
 
-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)]
index 6288d006e9470b8b18ff6973c32afaf236c98ee2..c7a420562880b52ae229d8ae9cedf22cb1672c73 100644 (file)
@@ -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;