@@ -30,7 +30,6 @@ use trans::callee;
30
30
use trans:: cleanup;
31
31
use trans:: cleanup:: CleanupMethods ;
32
32
use trans:: common:: * ;
33
- use trans:: consts;
34
33
use trans:: datum;
35
34
use trans:: debuginfo:: DebugLoc ;
36
35
use trans:: declare;
@@ -39,8 +38,7 @@ use trans::foreign;
39
38
use trans:: inline;
40
39
use trans:: machine:: * ;
41
40
use trans:: monomorphize;
42
- use trans:: tvec;
43
- use trans:: type_of:: { type_of, sizing_type_of, align_of} ;
41
+ use trans:: type_of:: { type_of, type_of_dtor, sizing_type_of, align_of} ;
44
42
use trans:: type_:: Type ;
45
43
use util:: ppaux;
46
44
use util:: ppaux:: { ty_to_short_str, Repr } ;
@@ -191,8 +189,9 @@ pub fn get_drop_glue<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> Val
191
189
} ;
192
190
193
191
let fn_nm = mangle_internal_name_by_type_and_seq ( ccx, t, "drop" ) ;
194
- let llfn = decl_cdecl_fn ( ccx, & fn_nm, llfnty, ty:: mk_nil ( ccx. tcx ( ) ) ) ;
195
- note_unique_llvm_symbol ( ccx, fn_nm. clone ( ) ) ;
192
+ let llfn = declare:: define_cfn ( ccx, & fn_nm, llfnty, ty:: mk_nil ( ccx. tcx ( ) ) ) . unwrap_or_else ( ||{
193
+ ccx. sess ( ) . bug ( & format ! ( "symbol `{}` already defined" , fn_nm) ) ;
194
+ } ) ;
196
195
ccx. available_drop_glues ( ) . borrow_mut ( ) . insert ( t, fn_nm) ;
197
196
198
197
let _s = StatRecorder :: new ( ccx, format ! ( "drop {}" , ty_to_short_str( ccx. tcx( ) , t) ) ) ;
0 commit comments