f11d993c0f
* master: (58 commits) Rustfmt all the things Don't make decisions on values that don't represent the decision Improving comments. Rustup Added rustfix to the test. Improve span shortening. Added "make_return" and "blockify" convenience methods in Sugg and used them in "needless_bool". Actually check for constants. Fixed potential mistakes with nesting. Added tests. formatting fix Update clippy_lints/src/needless_bool.rs formatting fix Fixing typo in CONTRIBUTING.md Fix breakage due to rust-lang/rust#57651 needless bool lint suggestion is wrapped in brackets if it is an "else" clause of an "if-else" statement Fix automatic suggestion on `use_self`. Remove negative integer literal checks. Fix `implicit_return` false positives. Run rustfmt Fixed breakage due to rust-lang/rust#57489 ...
44 lines
796 B
Rust
44 lines
796 B
Rust
#![warn(clippy::inline_always, clippy::deprecated_semver)]
|
|
#![allow(clippy::assertions_on_constants::assertions_on_constants)]
|
|
#[inline(always)]
|
|
fn test_attr_lint() {
|
|
assert!(true)
|
|
}
|
|
|
|
#[inline(always)]
|
|
fn false_positive_expr() {
|
|
unreachable!()
|
|
}
|
|
|
|
#[inline(always)]
|
|
fn false_positive_stmt() {
|
|
unreachable!();
|
|
}
|
|
|
|
#[inline(always)]
|
|
fn empty_and_false_positive_stmt() {
|
|
unreachable!();
|
|
}
|
|
|
|
#[deprecated(since = "forever")]
|
|
pub const SOME_CONST: u8 = 42;
|
|
|
|
#[deprecated(since = "1")]
|
|
pub const ANOTHER_CONST: u8 = 23;
|
|
|
|
#[deprecated(since = "0.1.1")]
|
|
pub const YET_ANOTHER_CONST: u8 = 0;
|
|
|
|
fn main() {
|
|
test_attr_lint();
|
|
if false {
|
|
false_positive_expr()
|
|
}
|
|
if false {
|
|
false_positive_stmt()
|
|
}
|
|
if false {
|
|
empty_and_false_positive_stmt()
|
|
}
|
|
}
|