Skip to content

Commit

Permalink
Use better ICE message when no MIR is available
Browse files Browse the repository at this point in the history
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 #80952 (comment)
  • Loading branch information
camelid committed Jan 13, 2021
1 parent 058a710 commit c3f7429
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 c3f7429

Please sign in to comment.