Skip to content

Commit e8e3270

Browse files
authored
Wrangle warnings (#960)
* un-pub some statics that don't have to be pub to fix build under deny(warnings) * Add allow() for const impl pattern that causes false positives in a rustc lint in derive macros; rust-lang/rust#120363
1 parent 091c84d commit e8e3270

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed

cli/tests/app/exit_status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use abscissa_core::testing::CmdRunner;
77
use once_cell::sync::Lazy;
88

9-
pub static RUNNER: Lazy<CmdRunner> = Lazy::new(|| CmdRunner::default());
9+
static RUNNER: Lazy<CmdRunner> = Lazy::new(|| CmdRunner::default());
1010

1111
#[test]
1212
fn no_args() {

cli/tests/generate_app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const TEST_COMMANDS: &[&str] = &[
1919
"clippy",
2020
];
2121

22-
pub static RUNNER: Lazy<CmdRunner> = Lazy::new(|| {
22+
static RUNNER: Lazy<CmdRunner> = Lazy::new(|| {
2323
let mut runner = CmdRunner::new("cargo");
2424
runner.exclusive();
2525
runner

derive/src/command.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ pub fn derive_command(s: Structure<'_>) -> TokenStream {
99
let subcommand_usage = quote!();
1010

1111
s.gen_impl(quote! {
12+
#[allow(unknown_lints)]
13+
#[allow(non_local_definitions)]
1214
gen impl Command for @Self {
1315
#[doc = "Name of this program as a string"]
1416
fn name() -> &'static str {
@@ -44,6 +46,8 @@ mod tests {
4446
expands to {
4547
#[allow(non_upper_case_globals)]
4648
const _DERIVE_Command_FOR_MyCommand: () = {
49+
#[allow(unknown_lints)]
50+
#[allow(non_local_definitions)]
4751
impl Command for MyCommand {
4852
#[doc = "Name of this program as a string"]
4953
fn name() -> & 'static str {
@@ -79,6 +83,8 @@ mod tests {
7983
expands to {
8084
#[allow(non_upper_case_globals)]
8185
const _DERIVE_Command_FOR_MyCommand: () = {
86+
#[allow(unknown_lints)]
87+
#[allow(non_local_definitions)]
8288
impl Command for MyCommand {
8389
#[doc = "Name of this program as a string"]
8490
fn name() -> & 'static str {

derive/src/component.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ pub fn derive_component(s: Structure<'_>) -> TokenStream {
1313
let dependency_methods = attrs.dependency_methods();
1414

1515
s.gen_impl(quote! {
16+
#[allow(unknown_lints)]
17+
#[allow(non_local_definitions)]
1618
gen impl<A> Component<A> for @Self
1719
where
1820
A: #abscissa_core::Application
@@ -199,6 +201,8 @@ mod tests {
199201
expands to {
200202
#[allow(non_upper_case_globals)]
201203
const _DERIVE_Component_A_FOR_MyComponent: () = {
204+
#[allow(unknown_lints)]
205+
#[allow(non_local_definitions)]
202206
impl<A> Component<A> for MyComponent
203207
where
204208
A: abscissa_core::Application

derive/src/runnable.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ pub fn derive_runnable(s: synstructure::Structure<'_>) -> proc_macro2::TokenStre
77
});
88

99
s.gen_impl(quote! {
10+
#[allow(unknown_lints)]
11+
#[allow(non_local_definitions)]
1012
gen impl Runnable for @Self {
1113
fn run(&self) {
1214
match *self { #body }
@@ -33,6 +35,8 @@ mod tests {
3335
expands to {
3436
#[allow(non_upper_case_globals)]
3537
const _DERIVE_Runnable_FOR_MyRunnable: () = {
38+
#[allow(unknown_lints)]
39+
#[allow(non_local_definitions)]
3640
impl Runnable for MyRunnable {
3741
fn run(&self) {
3842
match *self {

0 commit comments

Comments
 (0)