From 57d12c683b3783e2b9460fe5607a4d91f6b67de9 Mon Sep 17 00:00:00 2001 From: Antonio Gomes Date: Sun, 14 Jul 2024 01:45:24 -0300 Subject: 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 --- gcc/testsuite/rust/compile/shadow1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/testsuite/rust') 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 " } + x = x + 2; // { dg-error "cannot apply operator .+. to types bool and " } } -- cgit v1.1