remove useless #![deny]s

This commit is contained in:
Waffle Lapkin 2025-10-16 23:36:30 +02:00
parent 86dc39f49b
commit 08b4323bad
No known key found for this signature in database
6 changed files with 13 additions and 36 deletions

View file

@ -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

View file

@ -1,5 +1,3 @@
#![deny(dependency_on_unit_never_type_fallback)]
fn create_ok_default<C>() -> Result<C, ()>
where
C: Default,

View file

@ -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 <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
= 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 <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
= 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()?;

View file

@ -1,7 +1,5 @@
//@ run-rustfix
#![allow(unused)]
#![deny(dependency_on_unit_never_type_fallback)]
fn foo<T: Default>() -> Result<T, ()> {
Err(())

View file

@ -1,7 +1,5 @@
//@ run-rustfix
#![allow(unused)]
#![deny(dependency_on_unit_never_type_fallback)]
fn foo<T: Default>() -> Result<T, ()> {
Err(())

View file

@ -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 <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
= 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 <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
= 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::<()>()?;