Skip to content

Commit adcaa1b

Browse files
committed
Downgrade let_unit_value to pedantic
1 parent 949a5ba commit adcaa1b

File tree

8 files changed

+7
-10
lines changed

8 files changed

+7
-10
lines changed

clippy_lints/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11251125
LintId::of(&types::CAST_PRECISION_LOSS),
11261126
LintId::of(&types::CAST_SIGN_LOSS),
11271127
LintId::of(&types::INVALID_UPCAST_COMPARISONS),
1128+
LintId::of(&types::LET_UNIT_VALUE),
11281129
LintId::of(&types::LINKEDLIST),
11291130
LintId::of(&types::OPTION_OPTION),
11301131
LintId::of(&unicode::NON_ASCII_LITERAL),
@@ -1376,7 +1377,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
13761377
LintId::of(&types::FN_TO_NUMERIC_CAST),
13771378
LintId::of(&types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION),
13781379
LintId::of(&types::IMPLICIT_HASHER),
1379-
LintId::of(&types::LET_UNIT_VALUE),
13801380
LintId::of(&types::REDUNDANT_ALLOCATION),
13811381
LintId::of(&types::TYPE_COMPLEXITY),
13821382
LintId::of(&types::UNIT_ARG),
@@ -1489,7 +1489,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
14891489
LintId::of(&types::FN_TO_NUMERIC_CAST),
14901490
LintId::of(&types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION),
14911491
LintId::of(&types::IMPLICIT_HASHER),
1492-
LintId::of(&types::LET_UNIT_VALUE),
14931492
LintId::of(&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
14941493
LintId::of(&write::PRINTLN_EMPTY_STRING),
14951494
LintId::of(&write::PRINT_LITERAL),

clippy_lints/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ declare_clippy_lint! {
593593
/// };
594594
/// ```
595595
pub LET_UNIT_VALUE,
596-
style,
596+
pedantic,
597597
"creating a `let` binding to a value of unit type, which usually can't be used afterwards"
598598
}
599599

src/lintlist/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
999999
},
10001000
Lint {
10011001
name: "let_unit_value",
1002-
group: "style",
1002+
group: "pedantic",
10031003
desc: "creating a `let` binding to a value of unit type, which usually can\'t be used afterwards",
10041004
deprecation: None,
10051005
module: "types",

tests/ui/doc_unsafe.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ very_unsafe!();
8888
// we don't lint code from external macros
8989
undocd_unsafe!();
9090

91-
#[allow(clippy::let_unit_value)]
9291
fn main() {
9392
unsafe {
9493
you_dont_see_me();

tests/ui/redundant_pattern_matching.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#![warn(clippy::all)]
44
#![warn(clippy::redundant_pattern_matching)]
5-
#![allow(clippy::unit_arg, clippy::let_unit_value, unused_must_use)]
5+
#![allow(clippy::unit_arg, unused_must_use)]
66

77
fn main() {
88
Ok::<i32, i32>(42).is_ok();

tests/ui/redundant_pattern_matching.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#![warn(clippy::all)]
44
#![warn(clippy::redundant_pattern_matching)]
5-
#![allow(clippy::unit_arg, clippy::let_unit_value, unused_must_use)]
5+
#![allow(clippy::unit_arg, unused_must_use)]
66

77
fn main() {
88
if let Ok(_) = Ok::<i32, i32>(42) {}

tests/ui/uninit.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
use std::mem::MaybeUninit;
44

5-
#[allow(clippy::let_unit_value)]
65
fn main() {
76
let _: usize = unsafe { MaybeUninit::uninit().assume_init() };
87

tests/ui/uninit.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: this call for this type may be undefined behavior
2-
--> $DIR/uninit.rs:7:29
2+
--> $DIR/uninit.rs:6:29
33
|
44
LL | let _: usize = unsafe { MaybeUninit::uninit().assume_init() };
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `#[deny(clippy::uninit_assumed_init)]` on by default
88

99
error: this call for this type may be undefined behavior
10-
--> $DIR/uninit.rs:10:31
10+
--> $DIR/uninit.rs:9:31
1111
|
1212
LL | let _: [u8; 0] = unsafe { MaybeUninit::uninit().assume_init() };
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)