From cc30c202938e79126c4e94fc6719fc018f834cfb Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 22 Feb 2020 15:17:30 +0100 Subject: [PATCH] Silence some warnings --- src/base.rs | 1 + src/debuginfo/mod.rs | 4 ++-- src/intrinsics/mod.rs | 1 + src/intrinsics/simd.rs | 4 ++-- src/optimize/stack2reg.rs | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/base.rs b/src/base.rs index c741d02b8d7..963354e4218 100644 --- a/src/base.rs +++ b/src/base.rs @@ -283,6 +283,7 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, impl Backend>) { fn trans_stmt<'tcx>( fx: &mut FunctionCx<'_, 'tcx, impl Backend>, + #[allow(unused_variables)] cur_block: Block, stmt: &Statement<'tcx>, ) { diff --git a/src/debuginfo/mod.rs b/src/debuginfo/mod.rs index d4be26885a0..f9048ad4010 100644 --- a/src/debuginfo/mod.rs +++ b/src/debuginfo/mod.rs @@ -124,10 +124,10 @@ impl<'tcx> DebugContext<'tcx> { ty::Uint(_) => primitive(&mut self.dwarf, gimli::DW_ATE_unsigned), ty::Int(_) => primitive(&mut self.dwarf, gimli::DW_ATE_signed), ty::Float(_) => primitive(&mut self.dwarf, gimli::DW_ATE_float), - ty::Ref(_, pointee_ty, mutbl) + ty::Ref(_, pointee_ty, _mutbl) | ty::RawPtr(ty::TypeAndMut { ty: pointee_ty, - mutbl, + mutbl: _mutbl, }) => { let type_id = new_entry(&mut self.dwarf, gimli::DW_TAG_pointer_type); diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs index c8f23555952..53c699ef8c6 100644 --- a/src/intrinsics/mod.rs +++ b/src/intrinsics/mod.rs @@ -44,6 +44,7 @@ macro intrinsic_match { $( $($($name:tt).*)|+ $(if $cond:expr)?, $(<$($subst:ident),*>)? ($($a:ident $arg:ident),*) $content:block; )*) => { + let _ = $substs; // Silence warning when substs is unused. match $intrinsic { $( $(intrinsic_pat!($($name).*))|* $(if $cond)? => { diff --git a/src/intrinsics/simd.rs b/src/intrinsics/simd.rs index 04e55d80187..4d7bec0f06e 100644 --- a/src/intrinsics/simd.rs +++ b/src/intrinsics/simd.rs @@ -17,7 +17,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>( intrinsic_match! { fx, intrinsic, substs, args, _ => { - fx.tcx.sess.fatal(&format!("Unknown SIMD intrinsic {}", intrinsic)); + fx.tcx.sess.span_fatal(span, &format!("Unknown SIMD intrinsic {}", intrinsic)); }; simd_cast, (c a) { @@ -104,7 +104,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>( } }; - simd_insert, (c base, o idx, v val) { + simd_insert, (c base, o idx, v _val) { let idx_const = if let Some(idx_const) = crate::constant::mir_operand_get_const_val(fx, idx) { idx_const } else { diff --git a/src/optimize/stack2reg.rs b/src/optimize/stack2reg.rs index acce3a6465b..4e9cff76365 100644 --- a/src/optimize/stack2reg.rs +++ b/src/optimize/stack2reg.rs @@ -155,7 +155,7 @@ impl<'a> OptimizeContext<'a> { pub(super) fn optimize_function( ctx: &mut Context, - clif_comments: &mut crate::pretty_clif::CommentWriter, + _clif_comments: &mut crate::pretty_clif::CommentWriter, name: T, ) { combine_stack_addr_with_load_store(&mut ctx.func);