about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-08-18 10:58:17 +0000
committerbors <bors@rust-lang.org>2025-08-18 10:58:17 +0000
commit239e8b1b47b34120287ec36b33228c1e177f0c38 (patch)
tree06e9a3f02a63c3a276868124125ae83ce4dd56c8 /compiler/rustc_middle/src
parent425a9c0a0e365c0b8c6cfd00c2ded83a73bed9a0 (diff)
parentab57f43bc85197e7b64921a536fb7cb573b9ffc0 (diff)
downloadrust-239e8b1b47b34120287ec36b33228c1e177f0c38.tar.gz
rust-239e8b1b47b34120287ec36b33228c1e177f0c38.zip
Auto merge of #145551 - Zalathar:rollup-eo75r94, r=Zalathar
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#144838 (Fix outdated doc comment)
 - rust-lang/rust#145206 (Port `#[custom_mir(..)]` to the new attribute system)
 - rust-lang/rust#145208 (Implement declarative (`macro_rules!`) derive macros (RFC 3698))
 - rust-lang/rust#145309 (Fix `-Zregparm` for LLVM builtins)
 - rust-lang/rust#145355 (Add codegen test for issue 122734)
 - rust-lang/rust#145420 (cg_llvm: Use LLVM-C bindings for `LLVMSetTailCallKind`, `LLVMGetTypeKind`)
 - rust-lang/rust#145451 (Add static glibc to the nix dev shell)
 - rust-lang/rust#145460 (Speedup `copy_src_dirs` in bootstrap)
 - rust-lang/rust#145476 (Fix typo in doc for library/std/src/fs.rs#set_permissions)
 - rust-lang/rust#145485 (Fix deprecation attributes on foreign statics)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/mir/mod.rs42
1 files changed, 0 insertions, 42 deletions
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs
index c55c7fc6002..c977e5329c2 100644
--- a/compiler/rustc_middle/src/mir/mod.rs
+++ b/compiler/rustc_middle/src/mir/mod.rs
@@ -115,48 +115,6 @@ impl MirPhase {
             MirPhase::Runtime(runtime_phase) => (3, 1 + runtime_phase as usize),
         }
     }
-
-    /// Parses a `MirPhase` from a pair of strings. Panics if this isn't possible for any reason.
-    pub fn parse(dialect: String, phase: Option<String>) -> Self {
-        match &*dialect.to_ascii_lowercase() {
-            "built" => {
-                assert!(phase.is_none(), "Cannot specify a phase for `Built` MIR");
-                MirPhase::Built
-            }
-            "analysis" => Self::Analysis(AnalysisPhase::parse(phase)),
-            "runtime" => Self::Runtime(RuntimePhase::parse(phase)),
-            _ => bug!("Unknown MIR dialect: '{}'", dialect),
-        }
-    }
-}
-
-impl AnalysisPhase {
-    pub fn parse(phase: Option<String>) -> Self {
-        let Some(phase) = phase else {
-            return Self::Initial;
-        };
-
-        match &*phase.to_ascii_lowercase() {
-            "initial" => Self::Initial,
-            "post_cleanup" | "post-cleanup" | "postcleanup" => Self::PostCleanup,
-            _ => bug!("Unknown analysis phase: '{}'", phase),
-        }
-    }
-}
-
-impl RuntimePhase {
-    pub fn parse(phase: Option<String>) -> Self {
-        let Some(phase) = phase else {
-            return Self::Initial;
-        };
-
-        match &*phase.to_ascii_lowercase() {
-            "initial" => Self::Initial,
-            "post_cleanup" | "post-cleanup" | "postcleanup" => Self::PostCleanup,
-            "optimized" => Self::Optimized,
-            _ => bug!("Unknown runtime phase: '{}'", phase),
-        }
-    }
 }
 
 /// Where a specific `mir::Body` comes from.