Skip to content

Commit 4d8c6d3

Browse files
authored
Merge pull request #277 from rust-lang/feature/global-visibility
Set visibility of global
2 parents 0cbf2b9 + a512e98 commit 4d8c6d3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: src/consts.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[cfg(feature = "master")]
2-
use gccjit::FnAttribute;
2+
use gccjit::{FnAttribute, VarAttribute, Visibility};
33
use gccjit::{Function, GlobalKind, LValue, RValue, ToRValue, Type};
44
use rustc_codegen_ssa::traits::{BaseTypeMethods, ConstMethods, DerivedTypeMethods, StaticMethods};
55
use rustc_middle::span_bug;
@@ -249,7 +249,8 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
249249
);
250250

251251
if !self.tcx.is_reachable_non_generic(def_id) {
252-
// TODO(antoyo): set visibility.
252+
#[cfg(feature = "master")]
253+
global.add_attribute(VarAttribute::Visibility(Visibility::Hidden));
253254
}
254255

255256
global

0 commit comments

Comments
 (0)