Skip to content

Commit d4a31bc

Browse files
committed
Rename the lint
1 parent 2a6161c commit d4a31bc

File tree

6 files changed

+41
-41
lines changed

6 files changed

+41
-41
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6280,7 +6280,7 @@ Released 2018-09-13
62806280
[`cyclomatic_complexity`]: https://rust-lang.github.io/rust-clippy/master/index.html#cyclomatic_complexity
62816281
[`dbg_macro`]: https://rust-lang.github.io/rust-clippy/master/index.html#dbg_macro
62826282
[`debug_assert_with_mut_call`]: https://rust-lang.github.io/rust-clippy/master/index.html#debug_assert_with_mut_call
6283-
[`decimal_bit_mask`]: https://rust-lang.github.io/rust-clippy/master/index.html#decimal_bit_mask
6283+
[`decimal_bitwise_operands`]: https://rust-lang.github.io/rust-clippy/master/index.html#decimal_bitwise_operands
62846284
[`decimal_literal_representation`]: https://rust-lang.github.io/rust-clippy/master/index.html#decimal_literal_representation
62856285
[`declare_interior_mutable_const`]: https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
62866286
[`default_constructed_unit_structs`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

clippy_lints/src/decimal_bit_mask.rs renamed to clippy_lints/src/decimal_bitwise_operands.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ declare_clippy_lint! {
2525
/// let a = 0b1110 & 0b0110;
2626
/// ```
2727
#[clippy::version = "1.92.0"]
28-
pub DECIMAL_BIT_MASK,
28+
pub DECIMAL_BITWISE_OPERANDS,
2929
nursery,
3030
"use binary, hex, or octal literals for bitwise operations"
3131
}
3232

33-
declare_lint_pass!(DecimalBitMask => [DECIMAL_BIT_MASK]);
33+
declare_lint_pass!(DecimalBitwiseOperands => [DECIMAL_BITWISE_OPERANDS]);
3434

3535
fn check_bitwise_binary_expr(cx: &LateContext<'_>, expr: &Expr<'_>) {
3636
if let ExprKind::Binary(op, left, right) = &expr.kind
@@ -77,15 +77,15 @@ fn is_power_of_twoish(lit: &Spanned<LitKind>) -> bool {
7777
fn emit_lint(cx: &LateContext<'_>, span: Span) {
7878
span_lint_and_help(
7979
cx,
80-
DECIMAL_BIT_MASK,
80+
DECIMAL_BITWISE_OPERANDS,
8181
span,
8282
"using decimal literal for bitwise operation",
8383
None,
8484
"use binary (0b...), hex (0x...), or octal (0o...) notation for better readability",
8585
);
8686
}
8787

88-
impl<'tcx> LateLintPass<'tcx> for DecimalBitMask {
88+
impl<'tcx> LateLintPass<'tcx> for DecimalBitwiseOperands {
8989
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
9090
if expr.span.from_expansion() {
9191
return;

clippy_lints/src/declared_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[
8888
crate::crate_in_macro_def::CRATE_IN_MACRO_DEF_INFO,
8989
crate::create_dir::CREATE_DIR_INFO,
9090
crate::dbg_macro::DBG_MACRO_INFO,
91-
crate::decimal_bit_mask::DECIMAL_BIT_MASK_INFO,
91+
crate::decimal_bitwise_operands::DECIMAL_BITWISE_OPERANDS_INFO,
9292
crate::default::DEFAULT_TRAIT_ACCESS_INFO,
9393
crate::default::FIELD_REASSIGN_WITH_DEFAULT_INFO,
9494
crate::default_constructed_unit_structs::DEFAULT_CONSTRUCTED_UNIT_STRUCTS_INFO,

clippy_lints/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ mod copy_iterator;
9696
mod crate_in_macro_def;
9797
mod create_dir;
9898
mod dbg_macro;
99-
mod decimal_bit_mask;
99+
mod decimal_bitwise_operands;
100100
mod default;
101101
mod default_constructed_unit_structs;
102102
mod default_instead_of_iter_empty;
@@ -846,7 +846,7 @@ pub fn register_lint_passes(store: &mut rustc_lint::LintStore, conf: &'static Co
846846
Box::new(|_| Box::new(cloned_ref_to_slice_refs::ClonedRefToSliceRefs::new(conf))),
847847
Box::new(|_| Box::new(infallible_try_from::InfallibleTryFrom)),
848848
Box::new(|_| Box::new(coerce_container_to_any::CoerceContainerToAny)),
849-
Box::new(|_| Box::new(decimal_bit_mask::DecimalBitMask)),
849+
Box::new(|_| Box::new(decimal_bitwise_operands::DecimalBitwiseOperands)),
850850
Box::new(|_| Box::new(toplevel_ref_arg::ToplevelRefArg)),
851851
Box::new(|_| Box::new(volatile_composites::VolatileComposites)),
852852
Box::new(|_| Box::<replace_box::ReplaceBox>::default()),

tests/ui/decimal_bit_mask.rs renamed to tests/ui/decimal_bitwise_operands.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![allow(clippy::erasing_op)]
22
#![allow(clippy::no_effect)]
3-
#![warn(clippy::decimal_bit_mask)]
3+
#![warn(clippy::decimal_bitwise_operands)]
44

55
macro_rules! bitwise_op {
66
($x:expr, $y:expr) => {
@@ -13,24 +13,24 @@ pub const SOME_CONST: i32 = 12345;
1313
fn main() {
1414
let mut x = 0;
1515
// BAD: Bitwise operation, decimal literal, one literal
16-
x & 99; //~ decimal_bit_mask
17-
x | (/* comment */99); //~ decimal_bit_mask
18-
x ^ (99); //~ decimal_bit_mask
19-
x &= 99; //~ decimal_bit_mask
20-
x |= 99; //~ decimal_bit_mask
21-
x ^= (99); //~ decimal_bit_mask
16+
x & 99; //~ decimal_bitwise_operands
17+
x | (/* comment */99); //~ decimal_bitwise_operands
18+
x ^ (99); //~ decimal_bitwise_operands
19+
x &= 99; //~ decimal_bitwise_operands
20+
x |= 99; //~ decimal_bitwise_operands
21+
x ^= (99); //~ decimal_bitwise_operands
2222

2323
// BAD: Bitwise operation, decimal literal, two literals
24-
0b1010 & 99; //~ decimal_bit_mask
25-
0b1010 | (99); //~ decimal_bit_mask
26-
0b1010 ^ (/* comment */99); //~ decimal_bit_mask
27-
99 & 0b1010; //~ decimal_bit_mask
28-
(99) | 0b1010; //~ decimal_bit_mask
29-
(/* comment */99) ^ 0b1010; //~ decimal_bit_mask
30-
0xD | 99; //~ decimal_bit_mask
24+
0b1010 & 99; //~ decimal_bitwise_operands
25+
0b1010 | (99); //~ decimal_bitwise_operands
26+
0b1010 ^ (/* comment */99); //~ decimal_bitwise_operands
27+
99 & 0b1010; //~ decimal_bitwise_operands
28+
(99) | 0b1010; //~ decimal_bitwise_operands
29+
(/* comment */99) ^ 0b1010; //~ decimal_bitwise_operands
30+
0xD | 99; //~ decimal_bitwise_operands
3131
88 & 99;
32-
//~^ decimal_bit_mask
33-
//~| decimal_bit_mask
32+
//~^ decimal_bitwise_operands
33+
//~| decimal_bitwise_operands
3434

3535
// GOOD: Bitwise operation, binary/hex/octal literal, one literal
3636
x & 0b1010;

tests/ui/decimal_bit_mask.stderr renamed to tests/ui/decimal_bitwise_operands.stderr

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,119 @@
11
error: using decimal literal for bitwise operation
2-
--> tests/ui/decimal_bit_mask.rs:16:9
2+
--> tests/ui/decimal_bitwise_operands.rs:16:9
33
|
44
LL | x & 99;
55
| ^^
66
|
77
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
8-
= note: `-D clippy::decimal-bit-mask` implied by `-D warnings`
9-
= help: to override `-D warnings` add `#[allow(clippy::decimal_bit_mask)]`
8+
= note: `-D clippy::decimal-bitwise-operands` implied by `-D warnings`
9+
= help: to override `-D warnings` add `#[allow(clippy::decimal_bitwise_operands)]`
1010

1111
error: using decimal literal for bitwise operation
12-
--> tests/ui/decimal_bit_mask.rs:17:23
12+
--> tests/ui/decimal_bitwise_operands.rs:17:23
1313
|
1414
LL | x | (/* comment */99);
1515
| ^^
1616
|
1717
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
1818

1919
error: using decimal literal for bitwise operation
20-
--> tests/ui/decimal_bit_mask.rs:18:10
20+
--> tests/ui/decimal_bitwise_operands.rs:18:10
2121
|
2222
LL | x ^ (99);
2323
| ^^
2424
|
2525
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
2626

2727
error: using decimal literal for bitwise operation
28-
--> tests/ui/decimal_bit_mask.rs:19:10
28+
--> tests/ui/decimal_bitwise_operands.rs:19:10
2929
|
3030
LL | x &= 99;
3131
| ^^
3232
|
3333
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
3434

3535
error: using decimal literal for bitwise operation
36-
--> tests/ui/decimal_bit_mask.rs:20:10
36+
--> tests/ui/decimal_bitwise_operands.rs:20:10
3737
|
3838
LL | x |= 99;
3939
| ^^
4040
|
4141
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
4242

4343
error: using decimal literal for bitwise operation
44-
--> tests/ui/decimal_bit_mask.rs:21:11
44+
--> tests/ui/decimal_bitwise_operands.rs:21:11
4545
|
4646
LL | x ^= (99);
4747
| ^^
4848
|
4949
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
5050

5151
error: using decimal literal for bitwise operation
52-
--> tests/ui/decimal_bit_mask.rs:24:14
52+
--> tests/ui/decimal_bitwise_operands.rs:24:14
5353
|
5454
LL | 0b1010 & 99;
5555
| ^^
5656
|
5757
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
5858

5959
error: using decimal literal for bitwise operation
60-
--> tests/ui/decimal_bit_mask.rs:25:15
60+
--> tests/ui/decimal_bitwise_operands.rs:25:15
6161
|
6262
LL | 0b1010 | (99);
6363
| ^^
6464
|
6565
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
6666

6767
error: using decimal literal for bitwise operation
68-
--> tests/ui/decimal_bit_mask.rs:26:28
68+
--> tests/ui/decimal_bitwise_operands.rs:26:28
6969
|
7070
LL | 0b1010 ^ (/* comment */99);
7171
| ^^
7272
|
7373
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
7474

7575
error: using decimal literal for bitwise operation
76-
--> tests/ui/decimal_bit_mask.rs:27:5
76+
--> tests/ui/decimal_bitwise_operands.rs:27:5
7777
|
7878
LL | 99 & 0b1010;
7979
| ^^
8080
|
8181
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
8282

8383
error: using decimal literal for bitwise operation
84-
--> tests/ui/decimal_bit_mask.rs:28:6
84+
--> tests/ui/decimal_bitwise_operands.rs:28:6
8585
|
8686
LL | (99) | 0b1010;
8787
| ^^
8888
|
8989
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
9090

9191
error: using decimal literal for bitwise operation
92-
--> tests/ui/decimal_bit_mask.rs:29:19
92+
--> tests/ui/decimal_bitwise_operands.rs:29:19
9393
|
9494
LL | (/* comment */99) ^ 0b1010;
9595
| ^^
9696
|
9797
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
9898

9999
error: using decimal literal for bitwise operation
100-
--> tests/ui/decimal_bit_mask.rs:30:11
100+
--> tests/ui/decimal_bitwise_operands.rs:30:11
101101
|
102102
LL | 0xD | 99;
103103
| ^^
104104
|
105105
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
106106

107107
error: using decimal literal for bitwise operation
108-
--> tests/ui/decimal_bit_mask.rs:31:5
108+
--> tests/ui/decimal_bitwise_operands.rs:31:5
109109
|
110110
LL | 88 & 99;
111111
| ^^
112112
|
113113
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
114114

115115
error: using decimal literal for bitwise operation
116-
--> tests/ui/decimal_bit_mask.rs:31:10
116+
--> tests/ui/decimal_bitwise_operands.rs:31:10
117117
|
118118
LL | 88 & 99;
119119
| ^^

0 commit comments

Comments
 (0)