2020-10-21 07:47:34 -05:00
|
|
|
#![allow(clippy::redundant_clone)]
|
|
|
|
#![feature(custom_inner_attributes)]
|
|
|
|
|
2022-10-21 16:35:39 -05:00
|
|
|
fn main() {}
|
2020-10-21 07:47:34 -05:00
|
|
|
|
2022-11-19 06:50:02 -06:00
|
|
|
#[clippy::msrv = "1.42.0"]
|
2022-10-21 16:35:39 -05:00
|
|
|
fn just_under_msrv() {
|
2021-09-03 01:34:34 -05:00
|
|
|
let log2_10 = 3.321928094887362;
|
|
|
|
}
|
|
|
|
|
2022-11-19 06:50:02 -06:00
|
|
|
#[clippy::msrv = "1.43.0"]
|
2022-10-21 16:35:39 -05:00
|
|
|
fn meets_msrv() {
|
|
|
|
let log2_10 = 3.321928094887362;
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: approximate value of `f{32, 64}::consts::LOG2_10` found
|
2020-10-21 07:47:34 -05:00
|
|
|
}
|
2020-11-29 05:38:56 -06:00
|
|
|
|
2022-11-19 06:50:02 -06:00
|
|
|
#[clippy::msrv = "1.44.0"]
|
2022-10-21 16:35:39 -05:00
|
|
|
fn just_above_msrv() {
|
|
|
|
let log2_10 = 3.321928094887362;
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: approximate value of `f{32, 64}::consts::LOG2_10` found
|
2020-11-29 05:38:56 -06:00
|
|
|
}
|
|
|
|
|
2022-11-19 06:50:02 -06:00
|
|
|
#[clippy::msrv = "1.42"]
|
2022-10-21 16:35:39 -05:00
|
|
|
fn no_patch_under() {
|
|
|
|
let log2_10 = 3.321928094887362;
|
2020-11-29 05:38:56 -06:00
|
|
|
}
|
2022-06-23 15:34:52 -05:00
|
|
|
|
2022-11-19 06:50:02 -06:00
|
|
|
#[clippy::msrv = "1.43"]
|
2022-10-21 16:35:39 -05:00
|
|
|
fn no_patch_meets() {
|
2022-11-19 06:50:02 -06:00
|
|
|
let log2_10 = 3.321928094887362;
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: approximate value of `f{32, 64}::consts::LOG2_10` found
|
2022-11-19 06:50:02 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn inner_attr_under() {
|
|
|
|
#![clippy::msrv = "1.42"]
|
|
|
|
let log2_10 = 3.321928094887362;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn inner_attr_meets() {
|
2022-10-21 16:35:39 -05:00
|
|
|
#![clippy::msrv = "1.43"]
|
|
|
|
let log2_10 = 3.321928094887362;
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: approximate value of `f{32, 64}::consts::LOG2_10` found
|
2022-06-23 15:34:52 -05:00
|
|
|
}
|
2022-11-21 08:37:51 -06:00
|
|
|
|
|
|
|
// https://github.com/rust-lang/rust-clippy/issues/6920
|
|
|
|
fn scoping() {
|
|
|
|
mod m {
|
|
|
|
#![clippy::msrv = "1.42.0"]
|
|
|
|
}
|
|
|
|
|
|
|
|
// Should warn
|
|
|
|
let log2_10 = 3.321928094887362;
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: approximate value of `f{32, 64}::consts::LOG2_10` found
|
2022-11-21 08:37:51 -06:00
|
|
|
|
|
|
|
mod a {
|
|
|
|
#![clippy::msrv = "1.42.0"]
|
|
|
|
|
|
|
|
fn should_warn() {
|
|
|
|
#![clippy::msrv = "1.43.0"]
|
|
|
|
let log2_10 = 3.321928094887362;
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: approximate value of `f{32, 64}::consts::LOG2_10` found
|
2022-11-21 08:37:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn should_not_warn() {
|
|
|
|
let log2_10 = 3.321928094887362;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|