Skip to content

Commit 9569691

Browse files
committed
rename lint; fix typo
1 parent fe42c97 commit 9569691

File tree

6 files changed

+21
-20
lines changed

6 files changed

+21
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5281,6 +5281,7 @@ Released 2018-09-13
52815281
[`int_plus_one`]: https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one
52825282
[`integer_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
52835283
[`integer_division`]: https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
5284+
[`integer_division_remainder_used`]: https://rust-lang.github.io/rust-clippy/master/index.html#integer_division_remainder_used
52845285
[`into_iter_on_array`]: https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_array
52855286
[`into_iter_on_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
52865287
[`into_iter_without_iter`]: https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_without_iter

clippy_lints/src/declared_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
139139
crate::disallowed_names::DISALLOWED_NAMES_INFO,
140140
crate::disallowed_script_idents::DISALLOWED_SCRIPT_IDENTS_INFO,
141141
crate::disallowed_types::DISALLOWED_TYPES_INFO,
142-
crate::division_remainder_used::DIVISION_REMAINDER_USED_INFO,
143142
crate::doc::DOC_LINK_WITH_QUOTES_INFO,
144143
crate::doc::DOC_MARKDOWN_INFO,
145144
crate::doc::EMPTY_DOCS_INFO,
@@ -236,6 +235,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
236235
crate::instant_subtraction::MANUAL_INSTANT_ELAPSED_INFO,
237236
crate::instant_subtraction::UNCHECKED_DURATION_SUBTRACTION_INFO,
238237
crate::int_plus_one::INT_PLUS_ONE_INFO,
238+
crate::integer_division_remainder_used::INTEGER_DIVISION_REMAINDER_USED_INFO,
239239
crate::invalid_upcast_comparisons::INVALID_UPCAST_COMPARISONS_INFO,
240240
crate::item_name_repetitions::ENUM_VARIANT_NAMES_INFO,
241241
crate::item_name_repetitions::MODULE_INCEPTION_INFO,

clippy_lints/src/division_remainder_used.rs renamed to clippy_lints/src/integer_division_remainder_used.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_session::declare_lint_pass;
88
declare_clippy_lint! {
99
/// ### What it does
1010
/// Checks for the usage of division (/) and remainder (%) operations
11-
/// when performed on any integer types using the default Div and Rem trait implementaions.
11+
/// when performed on any integer types using the default Div and Rem trait implementations.
1212
///
1313
/// ### Why is this bad?
1414
/// In cryptographic contexts, division can result in timing sidechannel vulnerabilities,
@@ -23,14 +23,14 @@ declare_clippy_lint! {
2323
/// let my_div = 10 >> 1;
2424
/// ```
2525
#[clippy::version = "1.78.0"]
26-
pub DIVISION_REMAINDER_USED,
26+
pub INTEGER_DIVISION_REMAINDER_USED,
2727
restriction,
2828
"use of disallowed default division and remainder operations"
2929
}
3030

31-
declare_lint_pass!(DivisionRemainderUsed => [DIVISION_REMAINDER_USED]);
31+
declare_lint_pass!(IntegerDivisionRemainderUsed => [INTEGER_DIVISION_REMAINDER_USED]);
3232

33-
impl LateLintPass<'_> for DivisionRemainderUsed {
33+
impl LateLintPass<'_> for IntegerDivisionRemainderUsed {
3434
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
3535
if let ExprKind::Binary(op, lhs, rhs) = &expr.kind
3636
&& let BinOpKind::Div | BinOpKind::Rem = op.node
@@ -41,7 +41,7 @@ impl LateLintPass<'_> for DivisionRemainderUsed {
4141
{
4242
span_lint(
4343
cx,
44-
DIVISION_REMAINDER_USED,
44+
INTEGER_DIVISION_REMAINDER_USED,
4545
expr.span.source_callsite(),
4646
&format!("use of {} has been disallowed in this context", op.node.as_str()),
4747
);

clippy_lints/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ mod disallowed_methods;
115115
mod disallowed_names;
116116
mod disallowed_script_idents;
117117
mod disallowed_types;
118-
mod division_remainder_used;
119118
mod doc;
120119
mod double_parens;
121120
mod drop_forget_ref;
@@ -173,6 +172,7 @@ mod init_numbered_fields;
173172
mod inline_fn_without_body;
174173
mod instant_subtraction;
175174
mod int_plus_one;
175+
mod integer_division_remainder_used;
176176
mod invalid_upcast_comparisons;
177177
mod item_name_repetitions;
178178
mod items_after_statements;
@@ -1123,7 +1123,7 @@ pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) {
11231123
store.register_early_pass(|| Box::new(multiple_bound_locations::MultipleBoundLocations));
11241124
store.register_late_pass(|_| Box::new(assigning_clones::AssigningClones));
11251125
store.register_late_pass(|_| Box::new(zero_repeat_side_effects::ZeroRepeatSideEffects));
1126-
store.register_late_pass(|_| Box::new(division_remainder_used::DivisionRemainderUsed));
1126+
store.register_late_pass(|_| Box::new(integer_division_remainder_used::IntegerDivisionRemainderUsed));
11271127
// add lints here, do not remove this comment, it's used in `new_lint`
11281128
}
11291129

tests/ui/division_remainder_used.rs renamed to tests/ui/integer_division_remainder_used.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![warn(clippy::division_remainder_used)]
1+
#![warn(clippy::integer_division_remainder_used)]
22
#![allow(unused_variables)]
33
#![allow(clippy::op_ref)]
44

tests/ui/division_remainder_used.stderr renamed to tests/ui/integer_division_remainder_used.stderr

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
11
error: use of / has been disallowed in this context
2-
--> tests/ui/division_remainder_used.rs:10:14
2+
--> tests/ui/integer_division_remainder_used.rs:10:14
33
|
44
LL | Self(self.0 / rhs.0)
55
| ^^^^^^^^^^^^^^
66
|
7-
= note: `-D clippy::division-remainder-used` implied by `-D warnings`
8-
= help: to override `-D warnings` add `#[allow(clippy::division_remainder_used)]`
7+
= note: `-D clippy::integer-division-remainder-used` implied by `-D warnings`
8+
= help: to override `-D warnings` add `#[allow(clippy::integer_division_remainder_used)]`
99

1010
error: use of % has been disallowed in this context
11-
--> tests/ui/division_remainder_used.rs:17:14
11+
--> tests/ui/integer_division_remainder_used.rs:17:14
1212
|
1313
LL | Self(self.0 % rhs.0)
1414
| ^^^^^^^^^^^^^^
1515

1616
error: use of / has been disallowed in this context
17-
--> tests/ui/division_remainder_used.rs:25:13
17+
--> tests/ui/integer_division_remainder_used.rs:25:13
1818
|
1919
LL | let c = a / b;
2020
| ^^^^^
2121

2222
error: use of % has been disallowed in this context
23-
--> tests/ui/division_remainder_used.rs:26:13
23+
--> tests/ui/integer_division_remainder_used.rs:26:13
2424
|
2525
LL | let d = a % b;
2626
| ^^^^^
2727

2828
error: use of / has been disallowed in this context
29-
--> tests/ui/division_remainder_used.rs:27:13
29+
--> tests/ui/integer_division_remainder_used.rs:27:13
3030
|
3131
LL | let e = &a / b;
3232
| ^^^^^^
3333

3434
error: use of % has been disallowed in this context
35-
--> tests/ui/division_remainder_used.rs:28:13
35+
--> tests/ui/integer_division_remainder_used.rs:28:13
3636
|
3737
LL | let f = a % &b;
3838
| ^^^^^^
3939

4040
error: use of / has been disallowed in this context
41-
--> tests/ui/division_remainder_used.rs:29:13
41+
--> tests/ui/integer_division_remainder_used.rs:29:13
4242
|
4343
LL | let g = &a / &b;
4444
| ^^^^^^^
4545

4646
error: use of % has been disallowed in this context
47-
--> tests/ui/division_remainder_used.rs:30:13
47+
--> tests/ui/integer_division_remainder_used.rs:30:13
4848
|
4949
LL | let h = &10 % b;
5050
| ^^^^^^^
5151

5252
error: use of / has been disallowed in this context
53-
--> tests/ui/division_remainder_used.rs:31:13
53+
--> tests/ui/integer_division_remainder_used.rs:31:13
5454
|
5555
LL | let i = a / &4;
5656
| ^^^^^^

0 commit comments

Comments
 (0)