diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2025-08-18 15:31:10 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-18 15:31:10 +1000 |
| commit | d92e1fe8d7c6d08e2921c40cfa38b625cb00a76d (patch) | |
| tree | 2069a21ce7b8ff836f149ddb99c7e8f10bdfc9c9 /compiler/rustc_middle/src | |
| parent | b94842dcac322010d6ca4abf3baa68f702ec0706 (diff) | |
| parent | 51bccdd1ab0802dd5a55bd06e956c8d547bdec2d (diff) | |
| download | rust-d92e1fe8d7c6d08e2921c40cfa38b625cb00a76d.tar.gz rust-d92e1fe8d7c6d08e2921c40cfa38b625cb00a76d.zip | |
Rollup merge of #145206 - scrabsha:push-uxovoqzrxnlx, r=jdonszelmann
Port `#[custom_mir(..)]` to the new attribute system r? ``````````@jdonszelmann``````````
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/mir/mod.rs | 42 |
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. |
