Rollup merge of #115353 - Enselic:no-optimized-mir, r=oli-obk
Emit error instead of ICE when optimized MIR is missing Closes #51388
This commit is contained in:
commit
a73c663ec4
6 changed files with 44 additions and 3 deletions
|
@ -192,7 +192,8 @@ use rustc_target::abi::Size;
|
|||
use std::path::PathBuf;
|
||||
|
||||
use crate::errors::{
|
||||
EncounteredErrorWhileInstantiating, LargeAssignmentsLint, RecursionLimit, TypeLengthLimit,
|
||||
EncounteredErrorWhileInstantiating, LargeAssignmentsLint, NoOptimizedMir, RecursionLimit,
|
||||
TypeLengthLimit,
|
||||
};
|
||||
|
||||
#[derive(PartialEq)]
|
||||
|
@ -960,7 +961,10 @@ fn should_codegen_locally<'tcx>(tcx: TyCtxt<'tcx>, instance: &Instance<'tcx>) ->
|
|||
}
|
||||
|
||||
if !tcx.is_mir_available(def_id) {
|
||||
bug!("no MIR available for {:?}", def_id);
|
||||
tcx.sess.emit_fatal(NoOptimizedMir {
|
||||
span: tcx.def_span(def_id),
|
||||
crate_name: tcx.crate_name(def_id.krate),
|
||||
});
|
||||
}
|
||||
|
||||
true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue