diff --git a/tests/ui/eq_op.rs b/tests/ui/eq_op.rs index 70c932a6c..ef573b2b9 100644 --- a/tests/ui/eq_op.rs +++ b/tests/ui/eq_op.rs @@ -89,6 +89,12 @@ fn main() { let z = x & &y; 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 { diff --git a/tests/ui/eq_op.stderr b/tests/ui/eq_op.stderr index 46c0ac108..ccf366062 100644 --- a/tests/ui/eq_op.stderr +++ b/tests/ui/eq_op.stderr @@ -204,5 +204,11 @@ error: taken reference of right operand | = 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