diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 47bdfbc7f383..1e965083d669 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -4065,7 +4065,6 @@ declare_lint! { /// ### Example /// /// ```rust,compile_fail - /// #![deny(never_type_fallback_flowing_into_unsafe)] /// fn main() { /// if true { /// // return has type `!` which, is some cases, causes never type fallback @@ -4122,7 +4121,7 @@ declare_lint! { /// ### Example /// /// ```rust,compile_fail,edition2021 - /// #![deny(dependency_on_unit_never_type_fallback)] + /// # #![deny(dependency_on_unit_never_type_fallback)] /// fn main() { /// if true { /// // return has type `!` which, is some cases, causes never type fallback diff --git a/tests/ui/never_type/dont-suggest-turbofish-from-expansion.rs b/tests/ui/never_type/dont-suggest-turbofish-from-expansion.rs index 9a53358464d8..7bae1ddc027f 100644 --- a/tests/ui/never_type/dont-suggest-turbofish-from-expansion.rs +++ b/tests/ui/never_type/dont-suggest-turbofish-from-expansion.rs @@ -1,5 +1,3 @@ -#![deny(dependency_on_unit_never_type_fallback)] - fn create_ok_default() -> Result where C: Default, diff --git a/tests/ui/never_type/dont-suggest-turbofish-from-expansion.stderr b/tests/ui/never_type/dont-suggest-turbofish-from-expansion.stderr index d2d108edb4db..9795acffe705 100644 --- a/tests/ui/never_type/dont-suggest-turbofish-from-expansion.stderr +++ b/tests/ui/never_type/dont-suggest-turbofish-from-expansion.stderr @@ -1,5 +1,5 @@ error: this function depends on never type fallback being `()` - --> $DIR/dont-suggest-turbofish-from-expansion.rs:10:1 + --> $DIR/dont-suggest-turbofish-from-expansion.rs:8:1 | LL | fn main() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8,15 +8,11 @@ LL | fn main() -> Result<(), ()> { = note: for more information, see = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail - --> $DIR/dont-suggest-turbofish-from-expansion.rs:14:23 + --> $DIR/dont-suggest-turbofish-from-expansion.rs:12:23 | LL | let created = create_ok_default()?; | ^^^^^^^^^^^^^^^^^^^ -note: the lint level is defined here - --> $DIR/dont-suggest-turbofish-from-expansion.rs:1:9 - | -LL | #![deny(dependency_on_unit_never_type_fallback)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[deny(dependency_on_unit_never_type_fallback)]` (part of `#[deny(rust_2024_compatibility)]`) on by default help: use `()` annotations to avoid fallback changes | LL | let created: () = create_ok_default()?; @@ -26,7 +22,7 @@ error: aborting due to 1 previous error Future incompatibility report: Future breakage diagnostic: error: this function depends on never type fallback being `()` - --> $DIR/dont-suggest-turbofish-from-expansion.rs:10:1 + --> $DIR/dont-suggest-turbofish-from-expansion.rs:8:1 | LL | fn main() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -35,15 +31,11 @@ LL | fn main() -> Result<(), ()> { = note: for more information, see = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail - --> $DIR/dont-suggest-turbofish-from-expansion.rs:14:23 + --> $DIR/dont-suggest-turbofish-from-expansion.rs:12:23 | LL | let created = create_ok_default()?; | ^^^^^^^^^^^^^^^^^^^ -note: the lint level is defined here - --> $DIR/dont-suggest-turbofish-from-expansion.rs:1:9 - | -LL | #![deny(dependency_on_unit_never_type_fallback)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[deny(dependency_on_unit_never_type_fallback)]` (part of `#[deny(rust_2024_compatibility)]`) on by default help: use `()` annotations to avoid fallback changes | LL | let created: () = create_ok_default()?; diff --git a/tests/ui/never_type/lint-breaking-2024-assign-underscore.fixed b/tests/ui/never_type/lint-breaking-2024-assign-underscore.fixed index f9f2b59a8c28..b235c6e4eb46 100644 --- a/tests/ui/never_type/lint-breaking-2024-assign-underscore.fixed +++ b/tests/ui/never_type/lint-breaking-2024-assign-underscore.fixed @@ -1,7 +1,5 @@ //@ run-rustfix - #![allow(unused)] -#![deny(dependency_on_unit_never_type_fallback)] fn foo() -> Result { Err(()) diff --git a/tests/ui/never_type/lint-breaking-2024-assign-underscore.rs b/tests/ui/never_type/lint-breaking-2024-assign-underscore.rs index 8a2f3d311ab9..14d88503e85f 100644 --- a/tests/ui/never_type/lint-breaking-2024-assign-underscore.rs +++ b/tests/ui/never_type/lint-breaking-2024-assign-underscore.rs @@ -1,7 +1,5 @@ //@ run-rustfix - #![allow(unused)] -#![deny(dependency_on_unit_never_type_fallback)] fn foo() -> Result { Err(()) diff --git a/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr b/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr index 6a85b9923d3e..96749de1195e 100644 --- a/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr +++ b/tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr @@ -1,5 +1,5 @@ error: this function depends on never type fallback being `()` - --> $DIR/lint-breaking-2024-assign-underscore.rs:10:1 + --> $DIR/lint-breaking-2024-assign-underscore.rs:8:1 | LL | fn test() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8,15 +8,11 @@ LL | fn test() -> Result<(), ()> { = note: for more information, see = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail - --> $DIR/lint-breaking-2024-assign-underscore.rs:13:9 + --> $DIR/lint-breaking-2024-assign-underscore.rs:11:9 | LL | _ = foo()?; | ^^^^^ -note: the lint level is defined here - --> $DIR/lint-breaking-2024-assign-underscore.rs:4:9 - | -LL | #![deny(dependency_on_unit_never_type_fallback)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[deny(dependency_on_unit_never_type_fallback)]` (part of `#[deny(rust_2024_compatibility)]`) on by default help: use `()` annotations to avoid fallback changes | LL | _ = foo::<()>()?; @@ -26,7 +22,7 @@ error: aborting due to 1 previous error Future incompatibility report: Future breakage diagnostic: error: this function depends on never type fallback being `()` - --> $DIR/lint-breaking-2024-assign-underscore.rs:10:1 + --> $DIR/lint-breaking-2024-assign-underscore.rs:8:1 | LL | fn test() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -35,15 +31,11 @@ LL | fn test() -> Result<(), ()> { = note: for more information, see = help: specify the types explicitly note: in edition 2024, the requirement `!: Default` will fail - --> $DIR/lint-breaking-2024-assign-underscore.rs:13:9 + --> $DIR/lint-breaking-2024-assign-underscore.rs:11:9 | LL | _ = foo()?; | ^^^^^ -note: the lint level is defined here - --> $DIR/lint-breaking-2024-assign-underscore.rs:4:9 - | -LL | #![deny(dependency_on_unit_never_type_fallback)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[deny(dependency_on_unit_never_type_fallback)]` (part of `#[deny(rust_2024_compatibility)]`) on by default help: use `()` annotations to avoid fallback changes | LL | _ = foo::<()>()?;