Skip to content

Commit cfe983e

Browse files
committed
rename lint
cargo dev rename_lint unchecked_duration_subtraction unchecked_time_subtraction
1 parent c5dbd1d commit cfe983e

12 files changed

+109
-96
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6453,6 +6453,7 @@ Released 2018-09-13
64536453
[`type_repetition_in_bounds`]: https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds
64546454
[`unbuffered_bytes`]: https://rust-lang.github.io/rust-clippy/master/index.html#unbuffered_bytes
64556455
[`unchecked_duration_subtraction`]: https://rust-lang.github.io/rust-clippy/master/index.html#unchecked_duration_subtraction
6456+
[`unchecked_time_subtraction`]: https://rust-lang.github.io/rust-clippy/master/index.html#unchecked_time_subtraction
64566457
[`unconditional_recursion`]: https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion
64576458
[`undocumented_unsafe_blocks`]: https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
64586459
[`undropped_manually_drops`]: https://rust-lang.github.io/rust-clippy/master/index.html#undropped_manually_drops

clippy_lints/src/declared_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ pub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[
224224
crate::init_numbered_fields::INIT_NUMBERED_FIELDS_INFO,
225225
crate::inline_fn_without_body::INLINE_FN_WITHOUT_BODY_INFO,
226226
crate::instant_subtraction::MANUAL_INSTANT_ELAPSED_INFO,
227-
crate::instant_subtraction::UNCHECKED_DURATION_SUBTRACTION_INFO,
227+
crate::instant_subtraction::UNCHECKED_TIME_SUBTRACTION_INFO,
228228
crate::int_plus_one::INT_PLUS_ONE_INFO,
229229
crate::integer_division_remainder_used::INTEGER_DIVISION_REMAINDER_USED_INFO,
230230
crate::invalid_upcast_comparisons::INVALID_UPCAST_COMPARISONS_INFO,

clippy_lints/src/deprecated_lints.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ declare_with_version! { RENAMED(RENAMED_VERSION) = [
182182
("clippy::transmute_int_to_float", "unnecessary_transmutes"),
183183
#[clippy::version = "1.88.0"]
184184
("clippy::transmute_num_to_bytes", "unnecessary_transmutes"),
185+
#[clippy::version = "1.90.0"]
186+
("clippy::unchecked_duration_subtraction", "clippy::unchecked_time_subtraction"),
185187
#[clippy::version = ""]
186188
("clippy::undropped_manually_drops", "undropped_manually_drops"),
187189
#[clippy::version = ""]

clippy_lints/src/instant_subtraction.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ declare_clippy_lint! {
5959
/// let time_passed = Instant::now().checked_sub(Duration::from_secs(5));
6060
/// ```
6161
#[clippy::version = "1.67.0"]
62-
pub UNCHECKED_DURATION_SUBTRACTION,
62+
pub UNCHECKED_TIME_SUBTRACTION,
6363
pedantic,
6464
"finds unchecked subtraction of a 'Duration' from an 'Instant'"
6565
}
@@ -74,7 +74,7 @@ impl InstantSubtraction {
7474
}
7575
}
7676

77-
impl_lint_pass!(InstantSubtraction => [MANUAL_INSTANT_ELAPSED, UNCHECKED_DURATION_SUBTRACTION]);
77+
impl_lint_pass!(InstantSubtraction => [MANUAL_INSTANT_ELAPSED, UNCHECKED_TIME_SUBTRACTION]);
7878

7979
impl LateLintPass<'_> for InstantSubtraction {
8080
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) {
@@ -142,7 +142,7 @@ fn print_unchecked_duration_subtraction_sugg(
142142

143143
span_lint_and_sugg(
144144
cx,
145-
UNCHECKED_DURATION_SUBTRACTION,
145+
UNCHECKED_TIME_SUBTRACTION,
146146
expr.span,
147147
"unchecked subtraction of a 'Duration' from an 'Instant'",
148148
"try",

tests/ui/manual_instant_elapsed.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![warn(clippy::manual_instant_elapsed)]
22
#![allow(clippy::unnecessary_operation)]
3-
#![allow(clippy::unchecked_duration_subtraction)]
3+
#![allow(clippy::unchecked_time_subtraction)]
44
#![allow(unused_variables)]
55
#![allow(unused_must_use)]
66

tests/ui/manual_instant_elapsed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![warn(clippy::manual_instant_elapsed)]
22
#![allow(clippy::unnecessary_operation)]
3-
#![allow(clippy::unchecked_duration_subtraction)]
3+
#![allow(clippy::unchecked_time_subtraction)]
44
#![allow(unused_variables)]
55
#![allow(unused_must_use)]
66

tests/ui/rename.fixed

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#![allow(clippy::missing_const_for_thread_local)]
5959
#![allow(clippy::recursive_format_impl)]
6060
#![allow(unnecessary_transmutes)]
61+
#![allow(clippy::unchecked_time_subtraction)]
6162
#![allow(undropped_manually_drops)]
6263
#![allow(unknown_lints)]
6364
#![allow(unused_labels)]
@@ -131,6 +132,7 @@
131132
#![warn(unnecessary_transmutes)] //~ ERROR: lint `clippy::transmute_int_to_char`
132133
#![warn(unnecessary_transmutes)] //~ ERROR: lint `clippy::transmute_int_to_float`
133134
#![warn(unnecessary_transmutes)] //~ ERROR: lint `clippy::transmute_num_to_bytes`
135+
#![warn(clippy::unchecked_time_subtraction)] //~ ERROR: lint `clippy::unchecked_duration_subtraction`
134136
#![warn(undropped_manually_drops)] //~ ERROR: lint `clippy::undropped_manually_drops`
135137
#![warn(unknown_lints)] //~ ERROR: lint `clippy::unknown_clippy_lints`
136138
#![warn(unused_labels)] //~ ERROR: lint `clippy::unused_label`

tests/ui/rename.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#![allow(clippy::missing_const_for_thread_local)]
5959
#![allow(clippy::recursive_format_impl)]
6060
#![allow(unnecessary_transmutes)]
61+
#![allow(clippy::unchecked_time_subtraction)]
6162
#![allow(undropped_manually_drops)]
6263
#![allow(unknown_lints)]
6364
#![allow(unused_labels)]
@@ -131,6 +132,7 @@
131132
#![warn(clippy::transmute_int_to_char)] //~ ERROR: lint `clippy::transmute_int_to_char`
132133
#![warn(clippy::transmute_int_to_float)] //~ ERROR: lint `clippy::transmute_int_to_float`
133134
#![warn(clippy::transmute_num_to_bytes)] //~ ERROR: lint `clippy::transmute_num_to_bytes`
135+
#![warn(clippy::unchecked_duration_subtraction)] //~ ERROR: lint `clippy::unchecked_duration_subtraction`
134136
#![warn(clippy::undropped_manually_drops)] //~ ERROR: lint `clippy::undropped_manually_drops`
135137
#![warn(clippy::unknown_clippy_lints)] //~ ERROR: lint `clippy::unknown_clippy_lints`
136138
#![warn(clippy::unused_label)] //~ ERROR: lint `clippy::unused_label`

0 commit comments

Comments
 (0)