From 42652565ee7da4053b24ec8cd1e31c0c30ac8174 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sat, 15 Sep 2018 09:15:48 -0700 Subject: [PATCH] Enable fatal warnings for the wasm32 linker Historically LLD has emitted warnings for various reasons but all the bugs have since been fixed (yay!) and by enabling fatal warnings we should be able to head off bugs like #53390 sooner. --- src/librustc_codegen_llvm/back/linker.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/librustc_codegen_llvm/back/linker.rs b/src/librustc_codegen_llvm/back/linker.rs index 95be2d82123a7..c03180c02fe63 100644 --- a/src/librustc_codegen_llvm/back/linker.rs +++ b/src/librustc_codegen_llvm/back/linker.rs @@ -1071,6 +1071,10 @@ impl<'a> Linker for WasmLd<'a> { // Make the default table accessible self.cmd.arg("--export-table"); + // Rust code should never have warnings, and warnings are often + // indicative of bugs, let's prevent them. + self.cmd.arg("--fatal-warnings"); + let mut cmd = Command::new(""); ::std::mem::swap(&mut cmd, &mut self.cmd); cmd