Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrangle warnings #960

Merged
merged 2 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/tests/app/exit_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use abscissa_core::testing::CmdRunner;
use once_cell::sync::Lazy;

pub static RUNNER: Lazy<CmdRunner> = Lazy::new(|| CmdRunner::default());
static RUNNER: Lazy<CmdRunner> = Lazy::new(|| CmdRunner::default());

#[test]
fn no_args() {
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/generate_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const TEST_COMMANDS: &[&str] = &[
"clippy",
];

pub static RUNNER: Lazy<CmdRunner> = Lazy::new(|| {
static RUNNER: Lazy<CmdRunner> = Lazy::new(|| {
let mut runner = CmdRunner::new("cargo");
runner.exclusive();
runner
Expand Down
6 changes: 6 additions & 0 deletions derive/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ pub fn derive_command(s: Structure<'_>) -> TokenStream {
let subcommand_usage = quote!();

s.gen_impl(quote! {
#[allow(unknown_lints)]
#[allow(non_local_definitions)]
gen impl Command for @Self {
#[doc = "Name of this program as a string"]
fn name() -> &'static str {
Expand Down Expand Up @@ -44,6 +46,8 @@ mod tests {
expands to {
#[allow(non_upper_case_globals)]
const _DERIVE_Command_FOR_MyCommand: () = {
#[allow(unknown_lints)]
#[allow(non_local_definitions)]
impl Command for MyCommand {
#[doc = "Name of this program as a string"]
fn name() -> & 'static str {
Expand Down Expand Up @@ -79,6 +83,8 @@ mod tests {
expands to {
#[allow(non_upper_case_globals)]
const _DERIVE_Command_FOR_MyCommand: () = {
#[allow(unknown_lints)]
#[allow(non_local_definitions)]
impl Command for MyCommand {
#[doc = "Name of this program as a string"]
fn name() -> & 'static str {
Expand Down
4 changes: 4 additions & 0 deletions derive/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ pub fn derive_component(s: Structure<'_>) -> TokenStream {
let dependency_methods = attrs.dependency_methods();

s.gen_impl(quote! {
#[allow(unknown_lints)]
#[allow(non_local_definitions)]
gen impl<A> Component<A> for @Self
where
A: #abscissa_core::Application
Expand Down Expand Up @@ -199,6 +201,8 @@ mod tests {
expands to {
#[allow(non_upper_case_globals)]
const _DERIVE_Component_A_FOR_MyComponent: () = {
#[allow(unknown_lints)]
#[allow(non_local_definitions)]
impl<A> Component<A> for MyComponent
where
A: abscissa_core::Application
Expand Down
4 changes: 4 additions & 0 deletions derive/src/runnable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ pub fn derive_runnable(s: synstructure::Structure<'_>) -> proc_macro2::TokenStre
});

s.gen_impl(quote! {
#[allow(unknown_lints)]
#[allow(non_local_definitions)]
gen impl Runnable for @Self {
fn run(&self) {
match *self { #body }
Expand All @@ -33,6 +35,8 @@ mod tests {
expands to {
#[allow(non_upper_case_globals)]
const _DERIVE_Runnable_FOR_MyRunnable: () = {
#[allow(unknown_lints)]
#[allow(non_local_definitions)]
impl Runnable for MyRunnable {
fn run(&self) {
match *self {
Expand Down
Loading