@@ -29,8 +29,8 @@ use middle::const_eval::eval_const_expr_partial;
2929use middle:: def_id:: DefId ;
3030use trans:: { adt, closure, debuginfo, expr, inline, machine} ;
3131use trans:: base:: { self , push_ctxt} ;
32+ use trans:: common:: { self , type_is_sized, ExprOrMethodCall , node_id_substs, C_nil , const_get_elt} ;
3233use 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} ;
3434use trans:: common:: { C_struct , C_undef , const_to_opt_int, const_to_opt_uint, VariantInfo , C_uint } ;
3535use trans:: common:: { type_is_fat_ptr, Field , C_vector , C_array , C_null , ExprId , MethodCallKey } ;
3636use trans:: declare;
@@ -795,7 +795,7 @@ fn const_expr_unadjusted<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
795795 }
796796 let opt_def = cx. tcx ( ) . def_map . borrow ( ) . get ( & cur. id ) . map ( |d| d. full_def ( ) ) ;
797797 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)
799799 } else {
800800 // If this isn't the address of a static, then keep going through
801801 // normal constant evaluation.
@@ -1075,15 +1075,3 @@ pub fn trans_static(ccx: &CrateContext,
10751075 Ok ( g)
10761076 }
10771077}
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