@@ -47,7 +47,7 @@ use middle::trans::builder::{Builder, noname};
47
47
use middle:: trans:: callee;
48
48
use middle:: trans:: cleanup:: { CleanupMethods , ScopeId } ;
49
49
use middle:: trans:: cleanup;
50
- use middle:: trans:: common:: { Block , C_bool , C_bytes_in_context , C_i32 , C_integral , C_nil } ;
50
+ use middle:: trans:: common:: { Block , C_bool , C_bytes_in_context , C_i32 , C_integral } ;
51
51
use middle:: trans:: common:: { C_null , C_struct_in_context , C_u64 , C_u8 , C_uint , C_undef } ;
52
52
use middle:: trans:: common:: { CrateContext , ExternMap , FunctionContext } ;
53
53
use middle:: trans:: common:: { NodeInfo , Result , SubstP } ;
@@ -529,7 +529,7 @@ pub fn get_res_dtor(ccx: &CrateContext,
529
529
let class_ty = ty:: lookup_item_type ( tcx, parent_id) . ty . subst ( tcx, substs) ;
530
530
let llty = type_of_dtor ( ccx, class_ty) ;
531
531
let dtor_ty = ty:: mk_ctor_fn ( ccx. tcx ( ) , ast:: DUMMY_NODE_ID ,
532
- [ glue:: get_drop_glue_type ( ccx, t) ] , ty:: mk_nil ( ) ) ;
532
+ [ glue:: get_drop_glue_type ( ccx, t) ] , ty:: mk_nil ( ccx . tcx ( ) ) ) ;
533
533
get_extern_fn ( ccx,
534
534
& mut * ccx. externs ( ) . borrow_mut ( ) ,
535
535
name. as_slice ( ) ,
@@ -563,7 +563,7 @@ pub fn compare_scalar_types<'blk, 'tcx>(cx: Block<'blk, 'tcx>,
563
563
let f = |a| Result :: new ( cx, compare_scalar_values ( cx, lhs, rhs, a, op) ) ;
564
564
565
565
match ty:: get ( t) . sty {
566
- ty:: ty_nil => f ( nil_type) ,
566
+ ty:: ty_tup ( ref tys ) if tys . is_empty ( ) => f ( nil_type) ,
567
567
ty:: ty_bool | ty:: ty_uint( _) | ty:: ty_char => f ( unsigned_int) ,
568
568
ty:: ty_ptr( mt) if ty:: type_is_sized ( cx. tcx ( ) , mt. ty ) => f ( unsigned_int) ,
569
569
ty:: ty_int( _) => f ( signed_int) ,
@@ -1590,12 +1590,6 @@ fn create_datums_for_fn_args_under_call_abi(
1590
1590
"argtuple" ) ) ;
1591
1591
result. push ( tuple) ;
1592
1592
}
1593
- ty:: ty_nil => {
1594
- let mode = datum:: Rvalue :: new ( datum:: ByValue ) ;
1595
- result. push ( datum:: Datum :: new ( C_nil ( bcx. ccx ( ) ) ,
1596
- ty:: mk_nil ( ) ,
1597
- mode) )
1598
- }
1599
1593
_ => {
1600
1594
bcx. tcx ( ) . sess . bug ( "last argument of a function with \
1601
1595
`rust-call` ABI isn't a tuple?!")
@@ -1659,10 +1653,8 @@ fn copy_unboxed_closure_args_to_allocas<'blk, 'tcx>(
1659
1653
arg_datum. to_lvalue_datum_in_scope( bcx,
1660
1654
"argtuple" ,
1661
1655
arg_scope_id) ) ;
1662
- let empty = Vec :: new ( ) ;
1663
1656
let untupled_arg_types = match ty:: get ( monomorphized_arg_types[ 0 ] ) . sty {
1664
1657
ty:: ty_tup( ref types) => types. as_slice ( ) ,
1665
- ty:: ty_nil => empty. as_slice ( ) ,
1666
1658
_ => {
1667
1659
bcx. tcx ( ) . sess . span_bug ( args[ 0 ] . pat . span ,
1668
1660
"first arg to `rust-call` ABI function \
@@ -1836,7 +1828,7 @@ pub fn trans_closure(ccx: &CrateContext,
1836
1828
NotUnboxedClosure => monomorphized_arg_types,
1837
1829
1838
1830
// Tuple up closure argument types for the "rust-call" ABI.
1839
- IsUnboxedClosure => vec![ ty:: mk_tup_or_nil ( ccx. tcx( ) , monomorphized_arg_types) ]
1831
+ IsUnboxedClosure => vec![ ty:: mk_tup ( ccx. tcx( ) , monomorphized_arg_types) ]
1840
1832
} ;
1841
1833
for monomorphized_arg_type in monomorphized_arg_types. iter( ) {
1842
1834
debug ! ( "trans_closure: monomorphized_arg_type: {}" ,
@@ -2392,7 +2384,6 @@ pub fn get_fn_llvm_attributes(ccx: &CrateContext, fn_ty: ty::t)
2392
2384
assert ! ( abi == RustCall ) ;
2393
2385
2394
2386
match ty:: get ( fn_sig. inputs [ 0 ] ) . sty {
2395
- ty:: ty_nil => Vec :: new ( ) ,
2396
2387
ty:: ty_tup( ref inputs) => inputs. clone ( ) ,
2397
2388
_ => ccx. sess ( ) . bug ( "expected tuple'd inputs" )
2398
2389
}
@@ -2401,7 +2392,6 @@ pub fn get_fn_llvm_attributes(ccx: &CrateContext, fn_ty: ty::t)
2401
2392
let mut inputs = vec ! [ fn_sig. inputs[ 0 ] ] ;
2402
2393
2403
2394
match ty:: get ( fn_sig. inputs [ 1 ] ) . sty {
2404
- ty:: ty_nil => inputs,
2405
2395
ty:: ty_tup( ref t_in) => {
2406
2396
inputs. push_all ( t_in. as_slice ( ) ) ;
2407
2397
inputs
@@ -2544,7 +2534,7 @@ pub fn register_fn_llvmty(ccx: &CrateContext,
2544
2534
llfty : Type ) -> ValueRef {
2545
2535
debug ! ( "register_fn_llvmty id={} sym={}" , node_id, sym) ;
2546
2536
2547
- let llfn = decl_fn ( ccx, sym. as_slice ( ) , cc, llfty, ty:: FnConverging ( ty:: mk_nil ( ) ) ) ;
2537
+ let llfn = decl_fn ( ccx, sym. as_slice ( ) , cc, llfty, ty:: FnConverging ( ty:: mk_nil ( ccx . tcx ( ) ) ) ) ;
2548
2538
finish_register_fn ( ccx, sp, sym, node_id, llfn) ;
2549
2539
llfn
2550
2540
}
@@ -2576,7 +2566,7 @@ pub fn create_entry_wrapper(ccx: &CrateContext,
2576
2566
let llfty = Type :: func ( [ ccx. int_type ( ) , Type :: i8p ( ccx) . ptr_to ( ) ] ,
2577
2567
& ccx. int_type ( ) ) ;
2578
2568
2579
- let llfn = decl_cdecl_fn ( ccx, "main" , llfty, ty:: mk_nil ( ) ) ;
2569
+ let llfn = decl_cdecl_fn ( ccx, "main" , llfty, ty:: mk_nil ( ccx . tcx ( ) ) ) ;
2580
2570
2581
2571
// FIXME: #16581: Marking a symbol in the executable with `dllexport`
2582
2572
// linkage forces MinGW's linker to output a `.reloc` section for ASLR
0 commit comments