@@ -1235,7 +1235,8 @@ pub fn new_fn_ctxt<'a>(ccx: &'a CrateContext,
1235
1235
output_type : ty:: t ,
1236
1236
param_substs : & ' a param_substs ,
1237
1237
sp : Option < Span > ,
1238
- block_arena : & ' a TypedArena < Block < ' a > > )
1238
+ block_arena : & ' a TypedArena < Block < ' a > > ,
1239
+ handle_items : HandleItemsFlag )
1239
1240
-> FunctionContext < ' a > {
1240
1241
param_substs. validate ( ) ;
1241
1242
@@ -1268,7 +1269,8 @@ pub fn new_fn_ctxt<'a>(ccx: &'a CrateContext,
1268
1269
block_arena : block_arena,
1269
1270
ccx : ccx,
1270
1271
debug_context : debug_context,
1271
- scopes : RefCell :: new ( Vec :: new ( ) )
1272
+ scopes : RefCell :: new ( Vec :: new ( ) ) ,
1273
+ handle_items : handle_items,
1272
1274
} ;
1273
1275
1274
1276
if has_env {
@@ -1579,7 +1581,8 @@ pub fn trans_closure(ccx: &CrateContext,
1579
1581
abi : Abi ,
1580
1582
has_env : bool ,
1581
1583
is_unboxed_closure : IsUnboxedClosureFlag ,
1582
- maybe_load_env: <' a > |& ' a Block < ' a > | -> & ' a Block < ' a > ) {
1584
+ maybe_load_env: <' a > |& ' a Block < ' a > | -> & ' a Block < ' a > ,
1585
+ handle_items : HandleItemsFlag ) {
1583
1586
ccx. stats. n_closures. set( ccx. stats. n_closures. get ( ) + 1 ) ;
1584
1587
1585
1588
let _icx = push_ctxt( "trans_closure" ) ;
@@ -1596,7 +1599,8 @@ pub fn trans_closure(ccx: &CrateContext,
1596
1599
output_type,
1597
1600
param_substs,
1598
1601
Some ( body. span) ,
1599
- & arena) ;
1602
+ & arena,
1603
+ handle_items) ;
1600
1604
let mut bcx = init_function( & fcx, false , output_type) ;
1601
1605
1602
1606
// cleanup scope for the incoming arguments
@@ -1698,7 +1702,8 @@ pub fn trans_fn(ccx: &CrateContext,
1698
1702
llfndecl: ValueRef ,
1699
1703
param_substs: & param_substs,
1700
1704
id: ast:: NodeId ,
1701
- attrs: & [ ast:: Attribute ] ) {
1705
+ attrs: & [ ast:: Attribute ] ,
1706
+ handle_items: HandleItemsFlag ) {
1702
1707
let _s = StatRecorder :: new( ccx, ccx. tcx. map. path_to_string( id) . to_string( ) ) ;
1703
1708
debug!( "trans_fn(param_substs={})" , param_substs. repr( ccx. tcx( ) ) ) ;
1704
1709
let _icx = push_ctxt( "trans_fn" ) ;
@@ -1718,7 +1723,8 @@ pub fn trans_fn(ccx: &CrateContext,
1718
1723
abi,
1719
1724
false ,
1720
1725
NotUnboxedClosure ,
1721
- |bcx| bcx) ;
1726
+ |bcx| bcx,
1727
+ handle_items) ;
1722
1728
}
1723
1729
1724
1730
pub fn trans_enum_variant( ccx: & CrateContext ,
@@ -1824,7 +1830,7 @@ fn trans_enum_variant_or_tuple_like_struct(ccx: &CrateContext,
1824
1830
1825
1831
let arena = TypedArena :: new( ) ;
1826
1832
let fcx = new_fn_ctxt( ccx, llfndecl, ctor_id, false , result_ty,
1827
- param_substs, None , & arena) ;
1833
+ param_substs, None , & arena, TranslateItems ) ;
1828
1834
let bcx = init_function( & fcx, false , result_ty) ;
1829
1835
1830
1836
let arg_tys = ty:: ty_fn_args( ctor_ty) ;
@@ -1925,7 +1931,8 @@ pub fn trans_item(ccx: &CrateContext, item: &ast::Item) {
1925
1931
llfn,
1926
1932
& param_substs:: empty( ) ,
1927
1933
item. id,
1928
- item. attrs. as_slice( ) ) ;
1934
+ item. attrs. as_slice( ) ,
1935
+ TranslateItems ) ;
1929
1936
} else {
1930
1937
// Be sure to travel more than just one layer deep to catch nested
1931
1938
// items in blocks and such.
0 commit comments