]> gcc.gnu.org Git - gcc.git/commit
gccrs: Experiment with adding an error code to an error
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 7 Sep 2023 09:33:39 +0000 (11:33 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 7 Sep 2023 09:37:40 +0000 (11:37 +0200)
commit1aee5d2ace9ea8f35baf5b18e36caf44fe018ea3
tree3a0edf68fbf8d07d0140d5280eeea4b25e4978a1
parent1ad5ae5a45f2e3fc6948b35a3b052fdd48453704
gccrs: Experiment with adding an error code to an error

gcc/rust/ChangeLog:

* rust-diagnostics.cc (rust_error_at): New overload.
* rust-diagnostics.h (struct ErrorCode): New struct.
(rust_error_at): New.
(rust_be_error_at): Likewise.
* rust-gcc-diagnostics.cc (class rust_error_code_rule): New class.
(rust_be_error_at): New function.
* typecheck/rust-casts.cc (TypeCastRules::emit_cast_error): Emit E0054
when reporting invalid cast error.

gcc/testsuite/ChangeLog:

* rust/compile/bad_as_bool_char.rs: Add error code to testcase.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/rust/rust-diagnostics.cc
gcc/rust/rust-diagnostics.h
gcc/rust/rust-gcc-diagnostics.cc
gcc/rust/typecheck/rust-casts.cc
gcc/testsuite/rust/compile/bad_as_bool_char.rs
This page took 0.055931 seconds and 5 git commands to generate.