diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2019-08-19 16:24:08 +0200 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2019-08-19 16:27:21 +0200 |
| commit | 0e35e4ea1907e4de9527f6c4cd7bf41ac4c8dae2 (patch) | |
| tree | 038410cd01da9dd0f8a300b0d14c487a712324e4 | |
| parent | edbb5730ea966be9d810a3ec46db8245dce51b4e (diff) | |
| download | rust-0e35e4ea1907e4de9527f6c4cd7bf41ac4c8dae2.tar.gz rust-0e35e4ea1907e4de9527f6c4cd7bf41ac4c8dae2.zip | |
Set correct linkage for statics
| -rw-r--r-- | src/constant.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/constant.rs b/src/constant.rs index f035d8b9e06..960097f2d13 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -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) } }; |
