1
Fork 0

Set correct linkage for statics

This commit is contained in:
bjorn3 2019-08-19 16:24:08 +02:00
parent edbb5730ea
commit 0e35e4ea19

View file

@ -268,8 +268,11 @@ fn define_all_allocs(
_ => bug!("static const eval returned {:#?}", const_),
};
// FIXME set correct linkage
let data_id = data_id_for_static(tcx, module, def_id, Linkage::Export);
let data_id = data_id_for_static(tcx, module, def_id, if tcx.is_reachable_non_generic(def_id) {
Linkage::Export
} else {
Linkage::Local
});
(data_id, alloc)
}
};