diff options
author | Antonio Gomes <antoniospg100@gmail.com> | 2024-07-14 01:45:24 -0300 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-17 16:35:53 +0100 |
commit | 57d12c683b3783e2b9460fe5607a4d91f6b67de9 (patch) | |
tree | 496aa805b4843141f55fc548ec687edf2b804825 /gcc/testsuite | |
parent | 8a83c569101b8b84056fb698c5cf67a7f6ae6d91 (diff) | |
download | gcc-57d12c683b3783e2b9460fe5607a4d91f6b67de9.zip gcc-57d12c683b3783e2b9460fe5607a4d91f6b67de9.tar.gz gcc-57d12c683b3783e2b9460fe5607a4d91f6b67de9.tar.bz2 |
gccrs: Improve error messages for operator expressions
gcc/rust/ChangeLog:
* hir/tree/rust-hir-expr.h: Add new get_operator_str method in
ArithmeticOrLogicalExpr and CompoundAssignmentExpr
* hir/tree/rust-hir.cc: Likewise
* typecheck/rust-hir-type-check-expr.cc: Improve error message for
operator expressions to display the correct operator symbol
gcc/testsuite/ChangeLog:
* rust/compile/shadow1.rs: Fix test for new error message
Signed-off-by: Antonio Gomes <antoniospg100@gmail.com>
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/rust/compile/shadow1.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/testsuite/rust/compile/shadow1.rs b/gcc/testsuite/rust/compile/shadow1.rs index cef972a..43d2764 100644 --- a/gcc/testsuite/rust/compile/shadow1.rs +++ b/gcc/testsuite/rust/compile/shadow1.rs @@ -2,5 +2,5 @@ fn main() { let mut x = 5; let mut x; x = true; - x = x + 2; // { dg-error "cannot apply this operator to types bool and <integer>" } + x = x + 2; // { dg-error "cannot apply operator .+. to types bool and <integer>" } } |