Skip to content

Commit

Permalink
Make lint deny-by-default (for crater run)
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Dec 12, 2024
1 parent 495e2ed commit 0411790
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/default_could_be_derived.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ declare_lint! {
/// so the derive for `Default` for a struct is trivial, and for an enum
/// variant with no fields, which can be annotated with `#[default]`.
pub DEFAULT_COULD_BE_DERIVED,
Warn,
Deny,
"detect `Default` impl that could be derived"
}

Expand Down
3 changes: 1 addition & 2 deletions src/tools/clippy/tests/ui/new_without_default.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ LL | | }
LL | | }
| |_^
|
= note: `-D default-could-be-derived` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(default_could_be_derived)]`
= note: `#[deny(default_could_be_derived)]` on by default
help: you don't need to manually `impl Default`, you can derive it
|
LL ~ #[derive(Default)] pub struct Ok;
Expand Down
3 changes: 1 addition & 2 deletions src/tools/clippy/tests/ui/or_fun_call.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,7 @@ LL | | }
LL | | }
| |_____^
|
= note: `-D default-could-be-derived` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(default_could_be_derived)]`
= note: `#[deny(default_could_be_derived)]` on by default
help: you don't need to manually `impl Default`, you can derive it
|
LL ~ #[derive(Default)] struct FakeDefault;
Expand Down
3 changes: 1 addition & 2 deletions src/tools/clippy/tests/ui/unwrap_or_else_default.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ LL | | }
LL | | }
| |_____^
|
= note: `-D default-could-be-derived` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(default_could_be_derived)]`
= note: `#[deny(default_could_be_derived)]` on by default
help: you don't need to manually `impl Default`, you can derive it
|
LL ~ #[derive(Default)] struct HasDefaultAndDuplicate;
Expand Down

0 comments on commit 0411790

Please sign in to comment.