Skip to content

Commit 08b4323

Browse files
committed
remove useless #![deny]s
1 parent 86dc39f commit 08b4323

File tree

6 files changed

+13
-36
lines changed

6 files changed

+13
-36
lines changed

compiler/rustc_lint_defs/src/builtin.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4065,7 +4065,6 @@ declare_lint! {
40654065
/// ### Example
40664066
///
40674067
/// ```rust,compile_fail
4068-
/// #![deny(never_type_fallback_flowing_into_unsafe)]
40694068
/// fn main() {
40704069
/// if true {
40714070
/// // return has type `!` which, is some cases, causes never type fallback
@@ -4122,7 +4121,7 @@ declare_lint! {
41224121
/// ### Example
41234122
///
41244123
/// ```rust,compile_fail,edition2021
4125-
/// #![deny(dependency_on_unit_never_type_fallback)]
4124+
/// # #![deny(dependency_on_unit_never_type_fallback)]
41264125
/// fn main() {
41274126
/// if true {
41284127
/// // return has type `!` which, is some cases, causes never type fallback

tests/ui/never_type/dont-suggest-turbofish-from-expansion.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![deny(dependency_on_unit_never_type_fallback)]
2-
31
fn create_ok_default<C>() -> Result<C, ()>
42
where
53
C: Default,

tests/ui/never_type/dont-suggest-turbofish-from-expansion.stderr

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: this function depends on never type fallback being `()`
2-
--> $DIR/dont-suggest-turbofish-from-expansion.rs:10:1
2+
--> $DIR/dont-suggest-turbofish-from-expansion.rs:8:1
33
|
44
LL | fn main() -> Result<(), ()> {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,15 +8,11 @@ LL | fn main() -> Result<(), ()> {
88
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
99
= help: specify the types explicitly
1010
note: in edition 2024, the requirement `!: Default` will fail
11-
--> $DIR/dont-suggest-turbofish-from-expansion.rs:14:23
11+
--> $DIR/dont-suggest-turbofish-from-expansion.rs:12:23
1212
|
1313
LL | let created = create_ok_default()?;
1414
| ^^^^^^^^^^^^^^^^^^^
15-
note: the lint level is defined here
16-
--> $DIR/dont-suggest-turbofish-from-expansion.rs:1:9
17-
|
18-
LL | #![deny(dependency_on_unit_never_type_fallback)]
19-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15+
= note: `#[deny(dependency_on_unit_never_type_fallback)]` (part of `#[deny(rust_2024_compatibility)]`) on by default
2016
help: use `()` annotations to avoid fallback changes
2117
|
2218
LL | let created: () = create_ok_default()?;
@@ -26,7 +22,7 @@ error: aborting due to 1 previous error
2622

2723
Future incompatibility report: Future breakage diagnostic:
2824
error: this function depends on never type fallback being `()`
29-
--> $DIR/dont-suggest-turbofish-from-expansion.rs:10:1
25+
--> $DIR/dont-suggest-turbofish-from-expansion.rs:8:1
3026
|
3127
LL | fn main() -> Result<(), ()> {
3228
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -35,15 +31,11 @@ LL | fn main() -> Result<(), ()> {
3531
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
3632
= help: specify the types explicitly
3733
note: in edition 2024, the requirement `!: Default` will fail
38-
--> $DIR/dont-suggest-turbofish-from-expansion.rs:14:23
34+
--> $DIR/dont-suggest-turbofish-from-expansion.rs:12:23
3935
|
4036
LL | let created = create_ok_default()?;
4137
| ^^^^^^^^^^^^^^^^^^^
42-
note: the lint level is defined here
43-
--> $DIR/dont-suggest-turbofish-from-expansion.rs:1:9
44-
|
45-
LL | #![deny(dependency_on_unit_never_type_fallback)]
46-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38+
= note: `#[deny(dependency_on_unit_never_type_fallback)]` (part of `#[deny(rust_2024_compatibility)]`) on by default
4739
help: use `()` annotations to avoid fallback changes
4840
|
4941
LL | let created: () = create_ok_default()?;

tests/ui/never_type/lint-breaking-2024-assign-underscore.fixed

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//@ run-rustfix
2-
32
#![allow(unused)]
4-
#![deny(dependency_on_unit_never_type_fallback)]
53

64
fn foo<T: Default>() -> Result<T, ()> {
75
Err(())

tests/ui/never_type/lint-breaking-2024-assign-underscore.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//@ run-rustfix
2-
32
#![allow(unused)]
4-
#![deny(dependency_on_unit_never_type_fallback)]
53

64
fn foo<T: Default>() -> Result<T, ()> {
75
Err(())

tests/ui/never_type/lint-breaking-2024-assign-underscore.stderr

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: this function depends on never type fallback being `()`
2-
--> $DIR/lint-breaking-2024-assign-underscore.rs:10:1
2+
--> $DIR/lint-breaking-2024-assign-underscore.rs:8:1
33
|
44
LL | fn test() -> Result<(), ()> {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,15 +8,11 @@ LL | fn test() -> Result<(), ()> {
88
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
99
= help: specify the types explicitly
1010
note: in edition 2024, the requirement `!: Default` will fail
11-
--> $DIR/lint-breaking-2024-assign-underscore.rs:13:9
11+
--> $DIR/lint-breaking-2024-assign-underscore.rs:11:9
1212
|
1313
LL | _ = foo()?;
1414
| ^^^^^
15-
note: the lint level is defined here
16-
--> $DIR/lint-breaking-2024-assign-underscore.rs:4:9
17-
|
18-
LL | #![deny(dependency_on_unit_never_type_fallback)]
19-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15+
= note: `#[deny(dependency_on_unit_never_type_fallback)]` (part of `#[deny(rust_2024_compatibility)]`) on by default
2016
help: use `()` annotations to avoid fallback changes
2117
|
2218
LL | _ = foo::<()>()?;
@@ -26,7 +22,7 @@ error: aborting due to 1 previous error
2622

2723
Future incompatibility report: Future breakage diagnostic:
2824
error: this function depends on never type fallback being `()`
29-
--> $DIR/lint-breaking-2024-assign-underscore.rs:10:1
25+
--> $DIR/lint-breaking-2024-assign-underscore.rs:8:1
3026
|
3127
LL | fn test() -> Result<(), ()> {
3228
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -35,15 +31,11 @@ LL | fn test() -> Result<(), ()> {
3531
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html>
3632
= help: specify the types explicitly
3733
note: in edition 2024, the requirement `!: Default` will fail
38-
--> $DIR/lint-breaking-2024-assign-underscore.rs:13:9
34+
--> $DIR/lint-breaking-2024-assign-underscore.rs:11:9
3935
|
4036
LL | _ = foo()?;
4137
| ^^^^^
42-
note: the lint level is defined here
43-
--> $DIR/lint-breaking-2024-assign-underscore.rs:4:9
44-
|
45-
LL | #![deny(dependency_on_unit_never_type_fallback)]
46-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38+
= note: `#[deny(dependency_on_unit_never_type_fallback)]` (part of `#[deny(rust_2024_compatibility)]`) on by default
4739
help: use `()` annotations to avoid fallback changes
4840
|
4941
LL | _ = foo::<()>()?;

0 commit comments

Comments
 (0)