diff --git a/lalrpop-test/src/expr_module_attributes.lalrpop b/lalrpop-test/src/expr_module_attributes.lalrpop index 9ef5c1e..94fd3c5 100644 --- a/lalrpop-test/src/expr_module_attributes.lalrpop +++ b/lalrpop-test/src/expr_module_attributes.lalrpop @@ -1,4 +1,3 @@ -#![allow(clippy)] #![cfg_attr(feature = "cargo-clippy", allow(clippy))] grammar(scale: i32); diff --git a/lalrpop/src/lr1/codegen/base.rs b/lalrpop/src/lr1/codegen/base.rs index 1b850d5..209039f 100644 --- a/lalrpop/src/lr1/codegen/base.rs +++ b/lalrpop/src/lr1/codegen/base.rs @@ -131,6 +131,7 @@ impl<'codegen, 'grammar, W: Write, C> CodeGenerator<'codegen, 'grammar, W, C> { } } + rust!(self.out, "#[allow(dead_code)]"); try!(self.out.write_pub_fn_header(self.grammar, format!("parse_{}", self.user_start_symbol), type_parameters, diff --git a/lalrpop/src/rust/mod.rs b/lalrpop/src/rust/mod.rs index 222f240..275e9ce 100644 --- a/lalrpop/src/rust/mod.rs +++ b/lalrpop/src/rust/mod.rs @@ -202,7 +202,9 @@ impl RustWrite { } pub fn write_standard_uses(&mut self, prefix: &str) -> io::Result<()> { - // stuff that we plan to use + // Stuff that we plan to use. + // Occasionally we happen to not use it after all, hence the allow. + rust!(self, "#[allow(unused_extern_crates)]"); rust!(self, "extern crate lalrpop_util as {}lalrpop_util;", prefix);