diff --git a/src/intrinsics/llvm.rs b/src/intrinsics/llvm.rs index 20f8699d12a..5bbbc18b3f4 100644 --- a/src/intrinsics/llvm.rs +++ b/src/intrinsics/llvm.rs @@ -8,14 +8,14 @@ use rustc_middle::ty::subst::SubstsRef; pub(crate) fn codegen_llvm_intrinsic_call<'tcx>( fx: &mut FunctionCx<'_, '_, 'tcx>, intrinsic: &str, - substs: SubstsRef<'tcx>, + _substs: SubstsRef<'tcx>, args: &[mir::Operand<'tcx>], destination: Option<(CPlace<'tcx>, BasicBlock)>, ) { let ret = destination.unwrap().0; intrinsic_match! { - fx, intrinsic, substs, args, + fx, intrinsic, args, _ => { fx.tcx.sess.warn(&format!("unsupported llvm intrinsic {}; replacing with trap", intrinsic)); crate::trap::trap_unimplemented(fx, intrinsic); diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs index 693b0e21444..825b317d131 100644 --- a/src/intrinsics/mod.rs +++ b/src/intrinsics/mod.rs @@ -43,28 +43,21 @@ macro intrinsic_arg { } macro intrinsic_match { - ($fx:expr, $intrinsic:expr, $substs:expr, $args:expr, + ($fx:expr, $intrinsic:expr, $args:expr, _ => $unknown:block; $( $($($name:tt).*)|+ $(if $cond:expr)?, ($($a:ident $arg:ident),*) $content:block; )*) => { - let _ = $substs; // Silence warning when substs is unused. match $intrinsic { $( $(intrinsic_pat!($($name).*))|* $(if $cond)? => { - #[allow(unused_parens, non_snake_case)] - { - if let [$($arg),*] = $args { - let ($($arg,)*) = ( - $(intrinsic_arg!($a $fx, $arg),)* - ); - #[warn(unused_parens, non_snake_case)] - { - $content - } - } else { - bug!("wrong number of args for intrinsic {:?}", $intrinsic); - } + if let [$($arg),*] = $args { + let ($($arg,)*) = ( + $(intrinsic_arg!($a $fx, $arg),)* + ); + $content + } else { + bug!("wrong number of args for intrinsic {:?}", $intrinsic); } } )* @@ -357,7 +350,7 @@ fn codegen_regular_intrinsic_call<'tcx>( let usize_layout = fx.layout_of(fx.tcx.types.usize); intrinsic_match! { - fx, intrinsic, substs, args, + fx, intrinsic, args, _ => { fx.tcx.sess.span_fatal(span, &format!("unsupported intrinsic {}", intrinsic)); }; diff --git a/src/intrinsics/simd.rs b/src/intrinsics/simd.rs index 106a190096d..292d3ca45f1 100644 --- a/src/intrinsics/simd.rs +++ b/src/intrinsics/simd.rs @@ -68,13 +68,13 @@ macro simd_flt_binop($fx:expr, $op:ident($x:ident, $y:ident) -> $ret:ident) { pub(super) fn codegen_simd_intrinsic_call<'tcx>( fx: &mut FunctionCx<'_, '_, 'tcx>, intrinsic: Symbol, - substs: SubstsRef<'tcx>, + _substs: SubstsRef<'tcx>, args: &[mir::Operand<'tcx>], ret: CPlace<'tcx>, span: Span, ) { intrinsic_match! { - fx, intrinsic, substs, args, + fx, intrinsic, args, _ => { fx.tcx.sess.span_fatal(span, &format!("Unknown SIMD intrinsic {}", intrinsic)); };