diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2015-08-14 13:45:42 -0700 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2015-08-17 14:48:44 -0700 |
| commit | 891c91438da66e967314f74f7ad5c06ddf56d917 (patch) | |
| tree | d42c44953fda36f2fbbb3adabda1d2e16b755b5e | |
| parent | d792925b4d838ca6d15c2d86b0e3dc85f6a393fe (diff) | |
| download | rust-891c91438da66e967314f74f7ad5c06ddf56d917.tar.gz rust-891c91438da66e967314f74f7ad5c06ddf56d917.zip | |
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.)
| -rw-r--r-- | src/librustc_typeck/check/intrinsic.rs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/librustc_typeck/check/intrinsic.rs b/src/librustc_typeck/check/intrinsic.rs index fe59054dd08..636f17db38c 100644 --- a/src/librustc_typeck/check/intrinsic.rs +++ b/src/librustc_typeck/check/intrinsic.rs @@ -13,7 +13,6 @@ use astconv::AstConv; use intrinsics; -use middle::infer; use middle::subst; use middle::ty::FnSig; use middle::ty::{self, Ty}; @@ -29,7 +28,6 @@ use syntax::codemap::Span; use syntax::parse::token; fn equate_intrinsic_type<'a, 'tcx>(tcx: &ty::ctxt<'tcx>, it: &ast::ForeignItem, - maybe_infcx: Option<&infer::InferCtxt<'a, 'tcx>>, n_tps: usize, abi: abi::Abi, inputs: Vec<ty::Ty<'tcx>>, @@ -52,7 +50,7 @@ fn equate_intrinsic_type<'a, 'tcx>(tcx: &ty::ctxt<'tcx>, it: &ast::ForeignItem, i_n_tps, n_tps); } else { require_same_types(tcx, - maybe_infcx, + None, false, it.span, i_ty.ty, @@ -349,7 +347,6 @@ pub fn check_intrinsic_type(ccx: &CrateCtxt, it: &ast::ForeignItem) { equate_intrinsic_type( tcx, it, - None, n_tps, abi::RustIntrinsic, inputs, @@ -369,7 +366,6 @@ pub fn check_platform_intrinsic_type(ccx: &CrateCtxt, let i_ty = tcx.lookup_item_type(local_def(it.id)); let i_n_tps = i_ty.generics.types.len(subst::FnSpace); let name = it.ident.name.as_str(); - let mut infer_ctxt = None; let (n_tps, inputs, output) = match &*name { "simd_eq" | "simd_ne" | "simd_lt" | "simd_le" | "simd_gt" | "simd_ge" => { @@ -388,11 +384,7 @@ pub fn check_platform_intrinsic_type(ccx: &CrateCtxt, Ok(n) => { let params = vec![param(0), param(0), tcx.mk_ty(ty::TyArray(tcx.types.u32, n))]; - - let ictxt = infer::new_infer_ctxt(tcx, &tcx.tables, None, false); - let ret = ictxt.next_ty_var(); - infer_ctxt = Some(ictxt); - (2, params, ret) + (2, params, param(1)) } Err(_) => { span_err!(tcx.sess, it.span, E0439, @@ -438,7 +430,6 @@ pub fn check_platform_intrinsic_type(ccx: &CrateCtxt, equate_intrinsic_type( tcx, it, - infer_ctxt.as_ref(), n_tps, abi::PlatformIntrinsic, inputs, |
