mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
Downgrade let_unit_value to pedantic
This commit is contained in:
parent
949a5bab33
commit
adcaa1b86d
8 changed files with 7 additions and 10 deletions
|
@ -1125,6 +1125,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
|||
LintId::of(&types::CAST_PRECISION_LOSS),
|
||||
LintId::of(&types::CAST_SIGN_LOSS),
|
||||
LintId::of(&types::INVALID_UPCAST_COMPARISONS),
|
||||
LintId::of(&types::LET_UNIT_VALUE),
|
||||
LintId::of(&types::LINKEDLIST),
|
||||
LintId::of(&types::OPTION_OPTION),
|
||||
LintId::of(&unicode::NON_ASCII_LITERAL),
|
||||
|
@ -1376,7 +1377,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
|||
LintId::of(&types::FN_TO_NUMERIC_CAST),
|
||||
LintId::of(&types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION),
|
||||
LintId::of(&types::IMPLICIT_HASHER),
|
||||
LintId::of(&types::LET_UNIT_VALUE),
|
||||
LintId::of(&types::REDUNDANT_ALLOCATION),
|
||||
LintId::of(&types::TYPE_COMPLEXITY),
|
||||
LintId::of(&types::UNIT_ARG),
|
||||
|
@ -1489,7 +1489,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
|||
LintId::of(&types::FN_TO_NUMERIC_CAST),
|
||||
LintId::of(&types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION),
|
||||
LintId::of(&types::IMPLICIT_HASHER),
|
||||
LintId::of(&types::LET_UNIT_VALUE),
|
||||
LintId::of(&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
|
||||
LintId::of(&write::PRINTLN_EMPTY_STRING),
|
||||
LintId::of(&write::PRINT_LITERAL),
|
||||
|
|
|
@ -593,7 +593,7 @@ declare_clippy_lint! {
|
|||
/// };
|
||||
/// ```
|
||||
pub LET_UNIT_VALUE,
|
||||
style,
|
||||
pedantic,
|
||||
"creating a `let` binding to a value of unit type, which usually can't be used afterwards"
|
||||
}
|
||||
|
||||
|
|
|
@ -999,7 +999,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
|
|||
},
|
||||
Lint {
|
||||
name: "let_unit_value",
|
||||
group: "style",
|
||||
group: "pedantic",
|
||||
desc: "creating a `let` binding to a value of unit type, which usually can\'t be used afterwards",
|
||||
deprecation: None,
|
||||
module: "types",
|
||||
|
|
|
@ -88,7 +88,6 @@ very_unsafe!();
|
|||
// we don't lint code from external macros
|
||||
undocd_unsafe!();
|
||||
|
||||
#[allow(clippy::let_unit_value)]
|
||||
fn main() {
|
||||
unsafe {
|
||||
you_dont_see_me();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#![warn(clippy::all)]
|
||||
#![warn(clippy::redundant_pattern_matching)]
|
||||
#![allow(clippy::unit_arg, clippy::let_unit_value, unused_must_use)]
|
||||
#![allow(clippy::unit_arg, unused_must_use)]
|
||||
|
||||
fn main() {
|
||||
Ok::<i32, i32>(42).is_ok();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#![warn(clippy::all)]
|
||||
#![warn(clippy::redundant_pattern_matching)]
|
||||
#![allow(clippy::unit_arg, clippy::let_unit_value, unused_must_use)]
|
||||
#![allow(clippy::unit_arg, unused_must_use)]
|
||||
|
||||
fn main() {
|
||||
if let Ok(_) = Ok::<i32, i32>(42) {}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
use std::mem::MaybeUninit;
|
||||
|
||||
#[allow(clippy::let_unit_value)]
|
||||
fn main() {
|
||||
let _: usize = unsafe { MaybeUninit::uninit().assume_init() };
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: this call for this type may be undefined behavior
|
||||
--> $DIR/uninit.rs:7:29
|
||||
--> $DIR/uninit.rs:6:29
|
||||
|
|
||||
LL | let _: usize = unsafe { MaybeUninit::uninit().assume_init() };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -7,7 +7,7 @@ LL | let _: usize = unsafe { MaybeUninit::uninit().assume_init() };
|
|||
= note: `#[deny(clippy::uninit_assumed_init)]` on by default
|
||||
|
||||
error: this call for this type may be undefined behavior
|
||||
--> $DIR/uninit.rs:10:31
|
||||
--> $DIR/uninit.rs:9:31
|
||||
|
|
||||
LL | let _: [u8; 0] = unsafe { MaybeUninit::uninit().assume_init() };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
Loading…
Reference in a new issue