@@ -12,6 +12,7 @@ impl<F: Fn() -> String> Drop for PrintOnPanic<F> {
12
12
pub fn trans_mono_item < ' a , ' clif , ' tcx : ' a , B : Backend + ' static > (
13
13
cx : & mut crate :: CodegenCx < ' a , ' clif , ' tcx , B > ,
14
14
mono_item : MonoItem < ' tcx > ,
15
+ linkage : Linkage ,
15
16
) {
16
17
let tcx = cx. tcx ;
17
18
match mono_item {
@@ -42,7 +43,7 @@ pub fn trans_mono_item<'a, 'clif, 'tcx: 'a, B: Backend + 'static>(
42
43
}
43
44
} ) ;
44
45
45
- trans_fn ( cx, inst) ;
46
+ trans_fn ( cx, inst, linkage ) ;
46
47
}
47
48
MonoItem :: Static ( def_id) => {
48
49
crate :: constant:: codegen_static ( & mut cx. ccx , def_id) ;
@@ -56,6 +57,7 @@ pub fn trans_mono_item<'a, 'clif, 'tcx: 'a, B: Backend + 'static>(
56
57
fn trans_fn < ' a , ' clif , ' tcx : ' a , B : Backend + ' static > (
57
58
cx : & mut crate :: CodegenCx < ' a , ' clif , ' tcx , B > ,
58
59
instance : Instance < ' tcx > ,
60
+ linkage : Linkage ,
59
61
) {
60
62
let tcx = cx. tcx ;
61
63
@@ -65,7 +67,7 @@ fn trans_fn<'a, 'clif, 'tcx: 'a, B: Backend + 'static>(
65
67
// Step 2. Declare function
66
68
let ( name, sig) = get_function_name_and_sig ( tcx, instance) ;
67
69
let func_id = cx. module
68
- . declare_function ( & name, Linkage :: Export , & sig)
70
+ . declare_function ( & name, linkage , & sig)
69
71
. unwrap ( ) ;
70
72
71
73
// Step 3. Make FunctionBuilder
0 commit comments