mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-25 11:57:25 +00:00
Add tests to ensure that issue #2420 is resolved
The issue was probably fixed by ff32d5f7
. Closes #2420.
This commit is contained in:
parent
589704e1dc
commit
2b68f00722
2 changed files with 13 additions and 1 deletions
|
@ -89,6 +89,12 @@ fn main() {
|
||||||
let z = x & &y;
|
let z = x & &y;
|
||||||
|
|
||||||
check_ignore_macro();
|
check_ignore_macro();
|
||||||
|
|
||||||
|
// named constants
|
||||||
|
const A: u32 = 10;
|
||||||
|
const B: u32 = 10;
|
||||||
|
const C: u32 = A / B; // ok, different named constants
|
||||||
|
const D: u32 = A / A;
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! check_if_named_foo {
|
macro_rules! check_if_named_foo {
|
||||||
|
|
|
@ -204,5 +204,11 @@ error: taken reference of right operand
|
||||||
|
|
|
|
||||||
= note: `-D op-ref` implied by `-D warnings`
|
= note: `-D op-ref` implied by `-D warnings`
|
||||||
|
|
||||||
error: aborting due to 33 previous errors
|
error: equal expressions as operands to `/`
|
||||||
|
--> $DIR/eq_op.rs:97:20
|
||||||
|
|
|
||||||
|
97 | const D: u32 = A / A;
|
||||||
|
| ^^^^^
|
||||||
|
|
||||||
|
error: aborting due to 34 previous errors
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue