Refuse to codegen an upstream static.
This commit is contained in:
parent
cc4dd6fc9f
commit
d3fee8dbf3
5 changed files with 33 additions and 0 deletions
|
@ -1027,6 +1027,11 @@ fn should_codegen_locally<'tcx>(tcx: TyCtxt<'tcx>, instance: &Instance<'tcx>) ->
|
|||
return false;
|
||||
}
|
||||
|
||||
if let DefKind::Static(_) = tcx.def_kind(def_id) {
|
||||
// We cannot monomorphize statics from upstream crates.
|
||||
return false;
|
||||
}
|
||||
|
||||
if !tcx.is_mir_available(def_id) {
|
||||
bug!("no MIR available for {:?}", def_id);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue