diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-02-24 09:16:10 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-02-24 09:16:10 +1100 |
| commit | 1eddb158f9f804a9ca843d5ccce70c341340c9d2 (patch) | |
| tree | a5f0c3097ae4e1ec2f1e6843c0be1354e01d9455 /compiler/rustc_middle/src/mir/mod.rs | |
| parent | b522e7c5ea8334fbccb9dd7f9b33759304743fd0 (diff) | |
| download | rust-1eddb158f9f804a9ca843d5ccce70c341340c9d2.tar.gz rust-1eddb158f9f804a9ca843d5ccce70c341340c9d2.zip | |
Move `impl` blocks out of `rustc_middle/src/mir/syntax.rs`.
As the comment at the top says, this file is not supposed to contain any code. But some has crept in. This commit moves it out.
Diffstat (limited to 'compiler/rustc_middle/src/mir/mod.rs')
| -rw-r--r-- | compiler/rustc_middle/src/mir/mod.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index cf90df1b198..ea0bb5feb12 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -96,6 +96,17 @@ impl<'tcx> HasLocalDecls<'tcx> for Body<'tcx> { } impl MirPhase { + pub fn name(&self) -> &'static str { + match *self { + MirPhase::Built => "built", + MirPhase::Analysis(AnalysisPhase::Initial) => "analysis", + MirPhase::Analysis(AnalysisPhase::PostCleanup) => "analysis-post-cleanup", + MirPhase::Runtime(RuntimePhase::Initial) => "runtime", + MirPhase::Runtime(RuntimePhase::PostCleanup) => "runtime-post-cleanup", + MirPhase::Runtime(RuntimePhase::Optimized) => "runtime-optimized", + } + } + /// Gets the (dialect, phase) index of the current `MirPhase`. Both numbers /// are 1-indexed. pub fn index(&self) -> (usize, usize) { |
