Skip to content

Commit 2972ae5

Browse files
committed
rename_lint: unchecked_duration_subtraction to unchecked_time_subtraction
1 parent 49ae1d4 commit 2972ae5

14 files changed

+111
-98
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6702,6 +6702,7 @@ Released 2018-09-13
67026702
[`type_repetition_in_bounds`]: https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds
67036703
[`unbuffered_bytes`]: https://rust-lang.github.io/rust-clippy/master/index.html#unbuffered_bytes
67046704
[`unchecked_duration_subtraction`]: https://rust-lang.github.io/rust-clippy/master/index.html#unchecked_duration_subtraction
6705+
[`unchecked_time_subtraction`]: https://rust-lang.github.io/rust-clippy/master/index.html#unchecked_time_subtraction
67056706
[`unconditional_recursion`]: https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion
67066707
[`undocumented_unsafe_blocks`]: https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
67076708
[`undropped_manually_drops`]: https://rust-lang.github.io/rust-clippy/master/index.html#undropped_manually_drops

book/src/lint_configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ The minimum rust version that the project supports. Defaults to the `rust-versio
894894
* [`transmute_ptr_to_ref`](https://rust-lang.github.io/rust-clippy/master/index.html#transmute_ptr_to_ref)
895895
* [`tuple_array_conversions`](https://rust-lang.github.io/rust-clippy/master/index.html#tuple_array_conversions)
896896
* [`type_repetition_in_bounds`](https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds)
897-
* [`unchecked_duration_subtraction`](https://rust-lang.github.io/rust-clippy/master/index.html#unchecked_duration_subtraction)
897+
* [`unchecked_time_subtraction`](https://rust-lang.github.io/rust-clippy/master/index.html#unchecked_time_subtraction)
898898
* [`uninlined_format_args`](https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args)
899899
* [`unnecessary_lazy_evaluations`](https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations)
900900
* [`unnested_or_patterns`](https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns)

clippy_config/src/conf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ define_Conf! {
790790
transmute_ptr_to_ref,
791791
tuple_array_conversions,
792792
type_repetition_in_bounds,
793-
unchecked_duration_subtraction,
793+
unchecked_time_subtraction,
794794
uninlined_format_args,
795795
unnecessary_lazy_evaluations,
796796
unnested_or_patterns,

clippy_lints/src/declared_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ pub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[
227227
crate::init_numbered_fields::INIT_NUMBERED_FIELDS_INFO,
228228
crate::inline_fn_without_body::INLINE_FN_WITHOUT_BODY_INFO,
229229
crate::instant_subtraction::MANUAL_INSTANT_ELAPSED_INFO,
230-
crate::instant_subtraction::UNCHECKED_DURATION_SUBTRACTION_INFO,
230+
crate::instant_subtraction::UNCHECKED_TIME_SUBTRACTION_INFO,
231231
crate::int_plus_one::INT_PLUS_ONE_INFO,
232232
crate::integer_division_remainder_used::INTEGER_DIVISION_REMAINDER_USED_INFO,
233233
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
@@ -184,6 +184,8 @@ declare_with_version! { RENAMED(RENAMED_VERSION) = [
184184
("clippy::transmute_int_to_float", "unnecessary_transmutes"),
185185
#[clippy::version = "1.88.0"]
186186
("clippy::transmute_num_to_bytes", "unnecessary_transmutes"),
187+
#[clippy::version = "1.90.0"]
188+
("clippy::unchecked_duration_subtraction", "clippy::unchecked_time_subtraction"),
187189
#[clippy::version = ""]
188190
("clippy::undropped_manually_drops", "undropped_manually_drops"),
189191
#[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<'_>) {
@@ -141,7 +141,7 @@ fn print_unchecked_duration_subtraction_sugg(
141141

142142
span_lint_and_sugg(
143143
cx,
144-
UNCHECKED_DURATION_SUBTRACTION,
144+
UNCHECKED_TIME_SUBTRACTION,
145145
expr.span,
146146
"unchecked subtraction of a 'Duration' from an 'Instant'",
147147
"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)