Skip to content

Commit ae2ac3b

Browse files
committed
Allow let_underscore_drop and let_underscore_must_use by default.
These lints are very noisy and are allow-by-default in clippy anyways. Hence, setting them to allow-by-default here makes more sense than warning constantly on these cases.
1 parent 36b6309 commit ae2ac3b

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

compiler/rustc_lint/src/let_underscore.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ declare_lint! {
4141
/// calling `std::mem::drop` on the expression is clearer and helps convey
4242
/// intent.
4343
pub LET_UNDERSCORE_DROP,
44-
Warn,
44+
Allow,
4545
"non-binding let on a type that implements `Drop`"
4646
}
4747

@@ -104,7 +104,7 @@ declare_lint! {
104104
/// expression to immediately drop. Usually, it's better to explicitly handle
105105
/// the `must_use` expression.
106106
pub LET_UNDERSCORE_MUST_USE,
107-
Warn,
107+
Allow,
108108
"non-binding let on a expression marked `must_use`"
109109
}
110110

src/test/ui/let_underscore/let_underscore_drop.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// run-pass
2+
// compile-flags: -W let_underscore_drop
23

34
struct NontrivialDrop;
45

src/test/ui/let_underscore/let_underscore_drop.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
warning: non-binding let on a type that implements `Drop`
2-
--> $DIR/let_underscore_drop.rs:12:5
2+
--> $DIR/let_underscore_drop.rs:13:5
33
|
44
LL | let _ = NontrivialDrop;
55
| ^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `#[warn(let_underscore_drop)]` on by default
7+
= note: requested on the command line with `-W let-underscore-drop`
88
= help: consider binding to an unused variable
99
= help: consider explicitly droping with `std::mem::drop`
1010

src/test/ui/let_underscore/let_underscore_must_use.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// run-pass
2+
// compile-flags: -W let_underscore_must_use
23

34
#[must_use]
45
struct MustUseType;

src/test/ui/let_underscore/let_underscore_must_use.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
warning: non-binding let on a expression marked `must_use`
2-
--> $DIR/let_underscore_must_use.rs:10:5
2+
--> $DIR/let_underscore_must_use.rs:11:5
33
|
44
LL | let _ = MustUseType;
55
| ^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `#[warn(let_underscore_must_use)]` on by default
7+
= note: requested on the command line with `-W let-underscore-must-use`
88
= help: consider binding to an unused variable
99
= help: consider explicitly droping with `std::mem::drop`
1010

1111
warning: non-binding let on a expression marked `must_use`
12-
--> $DIR/let_underscore_must_use.rs:11:5
12+
--> $DIR/let_underscore_must_use.rs:12:5
1313
|
1414
LL | let _ = must_use_function();
1515
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)