Rollup merge of #112738 - matthiaskrgr:ice_msg, r=oli-obk

make ice msg "Unknown runtime phase" a bit nicer
This commit is contained in:
Matthias Krüger 2023-06-17 18:27:31 +02:00 committed by GitHub
commit 5518eb863f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,7 +145,7 @@ pub fn parse(dialect: String, phase: Option<String>) -> Self {
}
"analysis" => Self::Analysis(AnalysisPhase::parse(phase)),
"runtime" => Self::Runtime(RuntimePhase::parse(phase)),
_ => panic!("Unknown MIR dialect {}", dialect),
_ => bug!("Unknown MIR dialect: '{}'", dialect),
}
}
}
@ -159,7 +159,7 @@ pub fn parse(phase: Option<String>) -> Self {
match &*phase.to_ascii_lowercase() {
"initial" => Self::Initial,
"post_cleanup" | "post-cleanup" | "postcleanup" => Self::PostCleanup,
_ => panic!("Unknown analysis phase {}", phase),
_ => bug!("Unknown analysis phase: '{}'", phase),
}
}
}
@ -174,7 +174,7 @@ pub fn parse(phase: Option<String>) -> Self {
"initial" => Self::Initial,
"post_cleanup" | "post-cleanup" | "postcleanup" => Self::PostCleanup,
"optimized" => Self::Optimized,
_ => panic!("Unknown runtime phase {}", phase),
_ => bug!("Unknown runtime phase: '{}'", phase),
}
}
}