Skip to content

Commit

Permalink
Rollup merge of rust-lang#80969 - camelid:monomorph-ice-msg, r=nagisa
Browse files Browse the repository at this point in the history
Use better ICE message when no MIR is available

The ICE message is somewhat confusing and overly specific - the issue is
that there's no MIR available.

This should make debugging these ICEs easier since the error tells you
what's actually wrong, not what it was trying to do when it failed.

cc rust-lang#80952 (comment)
cc `````@jyn514`````
  • Loading branch information
m-ou-se committed Jan 14, 2021
2 parents 7855a73 + c3f7429 commit 90cc815
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_mir/src/monomorphize/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ fn should_codegen_locally<'tcx>(tcx: TyCtxt<'tcx>, instance: &Instance<'tcx>) ->
}

if !tcx.is_mir_available(def_id) {
bug!("cannot create local mono-item for {:?}", def_id)
bug!("no MIR available for {:?}", def_id);
}

true
Expand Down

0 comments on commit 90cc815

Please sign in to comment.