diff --git a/lib/codegen/src/lib.rs b/lib/codegen/src/lib.rs index 8f60d23ebe..faa21d24d7 100644 --- a/lib/codegen/src/lib.rs +++ b/lib/codegen/src/lib.rs @@ -1,7 +1,8 @@ //! Cretonne code generation library. #![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)] -#![warn(unused_import_braces, unstable_features)] +#![warn(unused_import_braces)] +#![cfg_attr(feature = "std", warn(unstable_features))] #![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr(feature="cargo-clippy", allow( // Rustfmt 0.9.0 is at odds with this lint: diff --git a/lib/codegen/src/regalloc/coalescing.rs b/lib/codegen/src/regalloc/coalescing.rs index 096c8546bc..2a70208c78 100644 --- a/lib/codegen/src/regalloc/coalescing.rs +++ b/lib/codegen/src/regalloc/coalescing.rs @@ -6,6 +6,7 @@ //! parameter will belong to the same virtual register as the EBB parameter value itself. use cursor::{Cursor, EncCursor}; +#[cfg(feature = "std")] use dbg::DisplayList; use dominator_tree::{DominatorTree, DominatorTreePreorder}; use flowgraph::ControlFlowGraph; @@ -546,8 +547,8 @@ impl<'a> Context<'a> { return false; } - let vreg = self.virtregs.unify(self.values); - dbg!("-> merged into {} = {}", vreg, DisplayList(self.values)); + let _vreg = self.virtregs.unify(self.values); + dbg!("-> merged into {} = {}", _vreg, DisplayList(self.values)); true } diff --git a/lib/codegen/src/regalloc/coloring.rs b/lib/codegen/src/regalloc/coloring.rs index e6281920d2..d080213ade 100644 --- a/lib/codegen/src/regalloc/coloring.rs +++ b/lib/codegen/src/regalloc/coloring.rs @@ -857,8 +857,11 @@ impl<'a> Context<'a> { let added = self.try_add_var(rc, throughs); debug_assert!(added, "Ran out of registers in {}", rc); } - Err(SolverError::Global(value)) => { - dbg!("Not enough global registers for {}, trying as local", value); + Err(SolverError::Global(_value)) => { + dbg!( + "Not enough global registers for {}, trying as local", + _value + ); // We'll clear the `is_global` flag on all solver variables and instead make a // note to replace all global defines with local defines followed by a copy. *replace_global_defines = true; diff --git a/lib/entity/src/lib.rs b/lib/entity/src/lib.rs index 7936495568..693e5d4f8c 100644 --- a/lib/entity/src/lib.rs +++ b/lib/entity/src/lib.rs @@ -30,7 +30,8 @@ //! `Vec`. #![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)] -#![warn(unused_import_braces, unstable_features)] +#![warn(unused_import_braces)] +#![cfg_attr(feature = "std", warn(unstable_features))] #![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))] diff --git a/lib/frontend/src/lib.rs b/lib/frontend/src/lib.rs index 3e43d04a84..b9880c9696 100644 --- a/lib/frontend/src/lib.rs +++ b/lib/frontend/src/lib.rs @@ -128,7 +128,8 @@ //! ``` #![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)] -#![warn(unused_import_braces, unstable_features)] +#![warn(unused_import_braces)] +#![cfg_attr(feature = "std", warn(unstable_features))] #![cfg_attr(feature = "cargo-clippy", allow(new_without_default))] #![cfg_attr(feature="cargo-clippy", warn( float_arithmetic, diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 422cb05931..d13b9f3d75 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -1024,9 +1024,9 @@ mod tests { let flags = settings::Flags::new(settings::builder()); match verify_function(&func, &flags) { Ok(()) => {} - Err(err) => { + Err(_err) => { #[cfg(feature = "std")] - panic!(err.message); + panic!(_err.message); #[cfg(not(feature = "std"))] panic!("function failed to verify"); } @@ -1203,9 +1203,9 @@ mod tests { let flags = settings::Flags::new(settings::builder()); match verify_function(&func, &flags) { Ok(()) => {} - Err(err) => { + Err(_err) => { #[cfg(feature = "std")] - panic!(err.message); + panic!(_err.message); #[cfg(not(feature = "std"))] panic!("function failed to verify"); } @@ -1254,9 +1254,9 @@ mod tests { let flags = settings::Flags::new(settings::builder()); match verify_function(&func, &flags) { Ok(()) => {} - Err(err) => { + Err(_err) => { #[cfg(feature = "std")] - panic!(err.message); + panic!(_err.message); #[cfg(not(feature = "std"))] panic!("function failed to verify"); } diff --git a/lib/wasm/src/lib.rs b/lib/wasm/src/lib.rs index b893e3b903..e20e939ca8 100644 --- a/lib/wasm/src/lib.rs +++ b/lib/wasm/src/lib.rs @@ -10,7 +10,8 @@ //! The main function of this module is [`translate_module`](fn.translate_module.html). #![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)] -#![warn(unused_import_braces, unstable_features)] +#![warn(unused_import_braces)] +#![cfg_attr(feature = "std", warn(unstable_features))] #![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]