@@ -29,8 +29,8 @@ use middle::const_eval::eval_const_expr_partial;
29
29
use middle:: def_id:: DefId ;
30
30
use trans:: { adt, closure, debuginfo, expr, inline, machine} ;
31
31
use trans:: base:: { self , push_ctxt} ;
32
+ use trans:: common:: { self , type_is_sized, ExprOrMethodCall , node_id_substs, C_nil , const_get_elt} ;
32
33
use trans:: common:: { CrateContext , C_integral , C_floating , C_bool , C_str_slice , C_bytes , val_ty} ;
33
- use trans:: common:: { type_is_sized, ExprOrMethodCall , node_id_substs, C_nil , const_get_elt} ;
34
34
use trans:: common:: { C_struct , C_undef , const_to_opt_int, const_to_opt_uint, VariantInfo , C_uint } ;
35
35
use trans:: common:: { type_is_fat_ptr, Field , C_vector , C_array , C_null , ExprId , MethodCallKey } ;
36
36
use trans:: declare;
@@ -795,7 +795,7 @@ fn const_expr_unadjusted<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
795
795
}
796
796
let opt_def = cx. tcx ( ) . def_map . borrow ( ) . get ( & cur. id ) . map ( |d| d. full_def ( ) ) ;
797
797
if let Some ( def:: DefStatic ( def_id, _) ) = opt_def {
798
- get_static_val ( cx, def_id, ety)
798
+ common :: get_static_val ( cx, def_id, ety)
799
799
} else {
800
800
// If this isn't the address of a static, then keep going through
801
801
// normal constant evaluation.
@@ -1075,15 +1075,3 @@ pub fn trans_static(ccx: &CrateContext,
1075
1075
Ok ( g)
1076
1076
}
1077
1077
}
1078
-
1079
-
1080
- fn get_static_val < ' a , ' tcx > ( ccx : & CrateContext < ' a , ' tcx > ,
1081
- did : DefId ,
1082
- ty : Ty < ' tcx > )
1083
- -> ValueRef {
1084
- if let Some ( node_id) = ccx. tcx ( ) . map . as_local_node_id ( did) {
1085
- base:: get_item_val ( ccx, node_id)
1086
- } else {
1087
- base:: trans_external_path ( ccx, did, ty)
1088
- }
1089
- }
0 commit comments