13
13
14
14
use astconv:: AstConv ;
15
15
use intrinsics;
16
- use middle:: infer;
17
16
use middle:: subst;
18
17
use middle:: ty:: FnSig ;
19
18
use middle:: ty:: { self , Ty } ;
@@ -29,7 +28,6 @@ use syntax::codemap::Span;
29
28
use syntax:: parse:: token;
30
29
31
30
fn equate_intrinsic_type < ' a , ' tcx > ( tcx : & ty:: ctxt < ' tcx > , it : & ast:: ForeignItem ,
32
- maybe_infcx : Option < & infer:: InferCtxt < ' a , ' tcx > > ,
33
31
n_tps : usize ,
34
32
abi : abi:: Abi ,
35
33
inputs : Vec < ty:: Ty < ' tcx > > ,
@@ -52,7 +50,7 @@ fn equate_intrinsic_type<'a, 'tcx>(tcx: &ty::ctxt<'tcx>, it: &ast::ForeignItem,
52
50
i_n_tps, n_tps) ;
53
51
} else {
54
52
require_same_types ( tcx,
55
- maybe_infcx ,
53
+ None ,
56
54
false ,
57
55
it. span ,
58
56
i_ty. ty ,
@@ -349,7 +347,6 @@ pub fn check_intrinsic_type(ccx: &CrateCtxt, it: &ast::ForeignItem) {
349
347
equate_intrinsic_type (
350
348
tcx,
351
349
it,
352
- None ,
353
350
n_tps,
354
351
abi:: RustIntrinsic ,
355
352
inputs,
@@ -369,7 +366,6 @@ pub fn check_platform_intrinsic_type(ccx: &CrateCtxt,
369
366
let i_ty = tcx. lookup_item_type ( local_def ( it. id ) ) ;
370
367
let i_n_tps = i_ty. generics . types . len ( subst:: FnSpace ) ;
371
368
let name = it. ident . name . as_str ( ) ;
372
- let mut infer_ctxt = None ;
373
369
374
370
let ( n_tps, inputs, output) = match & * name {
375
371
"simd_eq" | "simd_ne" | "simd_lt" | "simd_le" | "simd_gt" | "simd_ge" => {
@@ -388,11 +384,7 @@ pub fn check_platform_intrinsic_type(ccx: &CrateCtxt,
388
384
Ok ( n) => {
389
385
let params = vec ! [ param( 0 ) , param( 0 ) ,
390
386
tcx. mk_ty( ty:: TyArray ( tcx. types. u32 , n) ) ] ;
391
-
392
- let ictxt = infer:: new_infer_ctxt ( tcx, & tcx. tables , None , false ) ;
393
- let ret = ictxt. next_ty_var ( ) ;
394
- infer_ctxt = Some ( ictxt) ;
395
- ( 2 , params, ret)
387
+ ( 2 , params, param ( 1 ) )
396
388
}
397
389
Err ( _) => {
398
390
span_err ! ( tcx. sess, it. span, E0439 ,
@@ -438,7 +430,6 @@ pub fn check_platform_intrinsic_type(ccx: &CrateCtxt,
438
430
equate_intrinsic_type (
439
431
tcx,
440
432
it,
441
- infer_ctxt. as_ref ( ) ,
442
433
n_tps,
443
434
abi:: PlatformIntrinsic ,
444
435
inputs,
0 commit comments