diff options
| author | Caio <c410.f3r@gmail.com> | 2023-04-02 07:50:25 -0300 |
|---|---|---|
| committer | Caio <c410.f3r@gmail.com> | 2023-04-02 07:50:25 -0300 |
| commit | 05650b7215bfda4c03cab8acc16b83e67139d7de (patch) | |
| tree | 97f4dc3a1d11cee4d2a789e6a3a4d19f3cb6fde8 /tests | |
| parent | ac4838c554aeafbb1b0430c877bc7d879f8ea581 (diff) | |
[arithmetic_side_effects] Fix #10583
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/arithmetic_side_effects.rs | 4 | ||||
| -rw-r--r-- | tests/ui/arithmetic_side_effects.stderr | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/tests/ui/arithmetic_side_effects.rs b/tests/ui/arithmetic_side_effects.rs index ee7d2ba444b..3c06676d722 100644 --- a/tests/ui/arithmetic_side_effects.rs +++ b/tests/ui/arithmetic_side_effects.rs @@ -425,4 +425,8 @@ pub fn integer_arithmetic() { i ^= i; } +pub fn issue_10583(a: u16) -> u16 { + 10 / a +} + fn main() {} diff --git a/tests/ui/arithmetic_side_effects.stderr b/tests/ui/arithmetic_side_effects.stderr index 3895f08964c..2c8ee2884e7 100644 --- a/tests/ui/arithmetic_side_effects.stderr +++ b/tests/ui/arithmetic_side_effects.stderr @@ -577,6 +577,12 @@ LL | i * 2; | ^^^^^ error: arithmetic operation that can potentially result in unexpected side-effects + --> $DIR/arithmetic_side_effects.rs:394:5 + | +LL | 1 % i / 2; + | ^^^^^ + +error: arithmetic operation that can potentially result in unexpected side-effects --> $DIR/arithmetic_side_effects.rs:395:5 | LL | i - 2 + 2 - i; @@ -642,5 +648,11 @@ error: arithmetic operation that can potentially result in unexpected side-effec LL | i %= var2; | ^^^^^^^^^ -error: aborting due to 107 previous errors +error: arithmetic operation that can potentially result in unexpected side-effects + --> $DIR/arithmetic_side_effects.rs:429:5 + | +LL | 10 / a + | ^^^^^^ + +error: aborting due to 109 previous errors |
