Skip to content

Commit 891c914

Browse files
committed
simd_shuffleNNN returns its type parameter directly.
I.e. the signature now must be fn simd_shuffleNNN<T, U>(x: T, y: T, idx: [u32; NNN]) -> U; (modulo names.)
1 parent d792925 commit 891c914

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/librustc_typeck/check/intrinsic.rs

+2-11
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
1414
use astconv::AstConv;
1515
use intrinsics;
16-
use middle::infer;
1716
use middle::subst;
1817
use middle::ty::FnSig;
1918
use middle::ty::{self, Ty};
@@ -29,7 +28,6 @@ use syntax::codemap::Span;
2928
use syntax::parse::token;
3029

3130
fn equate_intrinsic_type<'a, 'tcx>(tcx: &ty::ctxt<'tcx>, it: &ast::ForeignItem,
32-
maybe_infcx: Option<&infer::InferCtxt<'a, 'tcx>>,
3331
n_tps: usize,
3432
abi: abi::Abi,
3533
inputs: Vec<ty::Ty<'tcx>>,
@@ -52,7 +50,7 @@ fn equate_intrinsic_type<'a, 'tcx>(tcx: &ty::ctxt<'tcx>, it: &ast::ForeignItem,
5250
i_n_tps, n_tps);
5351
} else {
5452
require_same_types(tcx,
55-
maybe_infcx,
53+
None,
5654
false,
5755
it.span,
5856
i_ty.ty,
@@ -349,7 +347,6 @@ pub fn check_intrinsic_type(ccx: &CrateCtxt, it: &ast::ForeignItem) {
349347
equate_intrinsic_type(
350348
tcx,
351349
it,
352-
None,
353350
n_tps,
354351
abi::RustIntrinsic,
355352
inputs,
@@ -369,7 +366,6 @@ pub fn check_platform_intrinsic_type(ccx: &CrateCtxt,
369366
let i_ty = tcx.lookup_item_type(local_def(it.id));
370367
let i_n_tps = i_ty.generics.types.len(subst::FnSpace);
371368
let name = it.ident.name.as_str();
372-
let mut infer_ctxt = None;
373369

374370
let (n_tps, inputs, output) = match &*name {
375371
"simd_eq" | "simd_ne" | "simd_lt" | "simd_le" | "simd_gt" | "simd_ge" => {
@@ -388,11 +384,7 @@ pub fn check_platform_intrinsic_type(ccx: &CrateCtxt,
388384
Ok(n) => {
389385
let params = vec![param(0), param(0),
390386
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))
396388
}
397389
Err(_) => {
398390
span_err!(tcx.sess, it.span, E0439,
@@ -438,7 +430,6 @@ pub fn check_platform_intrinsic_type(ccx: &CrateCtxt,
438430
equate_intrinsic_type(
439431
tcx,
440432
it,
441-
infer_ctxt.as_ref(),
442433
n_tps,
443434
abi::PlatformIntrinsic,
444435
inputs,

0 commit comments

Comments
 (0)