use std::iter;
-fn equate_intrinsic_type<'a, 'tcx>(
- tcx: TyCtxt<'a, 'tcx, 'tcx>,
+fn equate_intrinsic_type<'tcx>(
+ tcx: TyCtxt<'tcx, 'tcx>,
it: &hir::ForeignItem,
n_tps: usize,
abi: Abi,
"overflowing_add" | "overflowing_sub" | "overflowing_mul" |
"saturating_add" | "saturating_sub" |
"rotate_left" | "rotate_right" |
- "ctpop" | "ctlz" | "cttz" | "bswap" | "bitreverse"
+ "ctpop" | "ctlz" | "cttz" | "bswap" | "bitreverse" |
+ "minnumf32" | "minnumf64" | "maxnumf32" | "maxnumf64"
=> hir::Unsafety::Normal,
_ => hir::Unsafety::Unsafe,
}
/// Remember to add all intrinsics here, in librustc_codegen_llvm/intrinsic.rs,
/// and in libcore/intrinsics.rs
-pub fn check_intrinsic_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
- it: &hir::ForeignItem) {
+pub fn check_intrinsic_type<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, it: &hir::ForeignItem) {
let param = |n| tcx.mk_ty_param(n, InternedString::intern(&format!("P{}", n)));
let name = it.ident.as_str();
}
"fabsf32" => (0, vec![ tcx.types.f32 ], tcx.types.f32),
"fabsf64" => (0, vec![ tcx.types.f64 ], tcx.types.f64),
+ "minnumf32" => (0, vec![ tcx.types.f32, tcx.types.f32 ], tcx.types.f32),
+ "minnumf64" => (0, vec![ tcx.types.f64, tcx.types.f64 ], tcx.types.f64),
+ "maxnumf32" => (0, vec![ tcx.types.f32, tcx.types.f32 ], tcx.types.f32),
+ "maxnumf64" => (0, vec![ tcx.types.f64, tcx.types.f64 ], tcx.types.f64),
"copysignf32" => (0, vec![ tcx.types.f32, tcx.types.f32 ], tcx.types.f32),
"copysignf64" => (0, vec![ tcx.types.f64, tcx.types.f64 ], tcx.types.f64),
"floorf32" => (0, vec![ tcx.types.f32 ], tcx.types.f32),
"unchecked_shl" | "unchecked_shr" |
"rotate_left" | "rotate_right" =>
(1, vec![param(0), param(0)], param(0)),
-
+ "unchecked_add" | "unchecked_sub" | "unchecked_mul" =>
+ (1, vec![param(0), param(0)], param(0)),
"overflowing_add" | "overflowing_sub" | "overflowing_mul" =>
(1, vec![param(0), param(0)], param(0)),
"saturating_add" | "saturating_sub" =>
}
/// Type-check `extern "platform-intrinsic" { ... }` functions.
-pub fn check_platform_intrinsic_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
- it: &hir::ForeignItem) {
+pub fn check_platform_intrinsic_type<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, it: &hir::ForeignItem) {
let param = |n| {
let name = InternedString::intern(&format!("P{}", n));
tcx.mk_ty_param(n, name)