aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2021-02-09 11:48:12 +0000
committerPhilip Herron <herron.philip@googlemail.com>2021-02-10 13:21:00 +0000
commitc8b9c41bf248b952b0260c7b2f1e4c24cdaffae1 (patch)
treeefa332b10eb11be3d136eac8cdac6cccf2d94a3c /gcc
parentb96299b0b96b6714d5a7b03fa6d4f1ea7d09fc44 (diff)
downloadgcc-c8b9c41bf248b952b0260c7b2f1e4c24cdaffae1.zip
gcc-c8b9c41bf248b952b0260c7b2f1e4c24cdaffae1.tar.gz
gcc-c8b9c41bf248b952b0260c7b2f1e4c24cdaffae1.tar.bz2
Fix parsing |= as a compound assignment expression.
Fixes #173
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h2
-rw-r--r--gcc/testsuite/rust.test/compilable/compound_assignment_expr1.rs3
2 files changed, 3 insertions, 2 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 906f6b1..be71231 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -386,6 +386,8 @@ Parser<ManagedTokenSource>::left_binding_power (const_TokenPtr token)
return LBP_MOD_ASSIG;
case AMP_EQ:
return LBP_AMP_ASSIG;
+ case PIPE_EQ:
+ return LBP_PIPE_ASSIG;
case CARET_EQ:
return LBP_CARET_ASSIG;
case LEFT_SHIFT_EQ:
diff --git a/gcc/testsuite/rust.test/compilable/compound_assignment_expr1.rs b/gcc/testsuite/rust.test/compilable/compound_assignment_expr1.rs
index add4a5f..1ff0d24 100644
--- a/gcc/testsuite/rust.test/compilable/compound_assignment_expr1.rs
+++ b/gcc/testsuite/rust.test/compilable/compound_assignment_expr1.rs
@@ -16,8 +16,7 @@ fn main() {
d /= 4;
e %= 5;
f &= 6;
- // https://github.com/Rust-GCC/gccrs/issues/173
- // g |= 7;
+ g |= 7;
h ^= 8;
i <<= 9;
j >>= 10;