Don't go through the formatting infrastructure just to get the name of a phase
This commit is contained in:
parent
744a97b98c
commit
c2166ec628
3 changed files with 15 additions and 25 deletions
|
@ -89,6 +89,19 @@ pub enum MirPhase {
|
|||
Runtime(RuntimePhase),
|
||||
}
|
||||
|
||||
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",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// See [`MirPhase::Analysis`].
|
||||
#[derive(Copy, Clone, TyEncodable, TyDecodable, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(HashStable)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue