Skip to content

Commit 90b34cb

Browse files
committed
put the operators in backticks in the diagnostics
1 parent 7012a5d commit 90b34cb

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

clippy_lints/src/integer_division_remainder_used.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl LateLintPass<'_> for IntegerDivisionRemainderUsed {
4343
cx,
4444
INTEGER_DIVISION_REMAINDER_USED,
4545
expr.span.source_callsite(),
46-
format!("use of {} has been disallowed in this context", op.node.as_str()),
46+
format!("use of `{}` has been disallowed in this context", op.node.as_str()),
4747
);
4848
}
4949
}

tests/ui/integer_division_remainder_used.stderr

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

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

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

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

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

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

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

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

52-
error: use of / has been disallowed in this context
52+
error: use of `/` has been disallowed in this context
5353
--> tests/ui/integer_division_remainder_used.rs:39:13
5454
|
5555
LL | let i = a / &4;

0 commit comments

Comments
 (0)