Merge pull request #2565 from mikerite/issue_2420_tests_pr

Add tests to ensure that issue #2420 is resolved
This commit is contained in:
Oliver Schneider 2018-03-24 15:15:03 +01:00 committed by GitHub
commit 09725c8c0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View file

@ -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 {

View file

@ -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