Skip to content

Commit 5518eb8

Browse files
authored
Rollup merge of #112738 - matthiaskrgr:ice_msg, r=oli-obk
make ice msg "Unknown runtime phase" a bit nicer
2 parents 27af5ed + 32aee06 commit 5518eb8

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_middle/src/mir

1 file changed

+3
-3
lines changed

compiler/rustc_middle/src/mir/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl MirPhase {
145145
}
146146
"analysis" => Self::Analysis(AnalysisPhase::parse(phase)),
147147
"runtime" => Self::Runtime(RuntimePhase::parse(phase)),
148-
_ => panic!("Unknown MIR dialect {}", dialect),
148+
_ => bug!("Unknown MIR dialect: '{}'", dialect),
149149
}
150150
}
151151
}
@@ -159,7 +159,7 @@ impl AnalysisPhase {
159159
match &*phase.to_ascii_lowercase() {
160160
"initial" => Self::Initial,
161161
"post_cleanup" | "post-cleanup" | "postcleanup" => Self::PostCleanup,
162-
_ => panic!("Unknown analysis phase {}", phase),
162+
_ => bug!("Unknown analysis phase: '{}'", phase),
163163
}
164164
}
165165
}
@@ -174,7 +174,7 @@ impl RuntimePhase {
174174
"initial" => Self::Initial,
175175
"post_cleanup" | "post-cleanup" | "postcleanup" => Self::PostCleanup,
176176
"optimized" => Self::Optimized,
177-
_ => panic!("Unknown runtime phase {}", phase),
177+
_ => bug!("Unknown runtime phase: '{}'", phase),
178178
}
179179
}
180180
}

0 commit comments

Comments
 (0)