diff --git a/compiler/rustc_lint/src/default_could_be_derived.rs b/compiler/rustc_lint/src/default_could_be_derived.rs index 4028a038f36f..d0635c8f9067 100644 --- a/compiler/rustc_lint/src/default_could_be_derived.rs +++ b/compiler/rustc_lint/src/default_could_be_derived.rs @@ -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" } diff --git a/src/tools/clippy/tests/ui/new_without_default.stderr b/src/tools/clippy/tests/ui/new_without_default.stderr index 1ef62238982c..0c4a5f4f5df7 100644 --- a/src/tools/clippy/tests/ui/new_without_default.stderr +++ b/src/tools/clippy/tests/ui/new_without_default.stderr @@ -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; diff --git a/src/tools/clippy/tests/ui/or_fun_call.stderr b/src/tools/clippy/tests/ui/or_fun_call.stderr index 1cd2afcc14dd..44f96a159231 100644 --- a/src/tools/clippy/tests/ui/or_fun_call.stderr +++ b/src/tools/clippy/tests/ui/or_fun_call.stderr @@ -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; diff --git a/src/tools/clippy/tests/ui/unwrap_or_else_default.stderr b/src/tools/clippy/tests/ui/unwrap_or_else_default.stderr index 50c3a6db8531..6e86aac95bbb 100644 --- a/src/tools/clippy/tests/ui/unwrap_or_else_default.stderr +++ b/src/tools/clippy/tests/ui/unwrap_or_else_default.stderr @@ -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;