]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: [E0054/E0604/E0620/E0606] TypeCasting ErrorCodes
authorMuhammad Mahad <mahadtxt@gmail.com>
Sat, 5 Aug 2023 12:28:45 +0000 (17:28 +0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:00:29 +0000 (19:00 +0100)
commit2952785b1622cab80e95ee3922aac50a113b162a
treecc12e5a626cdf2310a2ae46318dc4d9262ccf611
parent2b20054948edca024f871a04c38c1d6ccb9c0bce
gccrs: [E0054/E0604/E0620/E0606] TypeCasting ErrorCodes

Added errorcodes according to different conditions
and updated error message according to type casting
type.

gcc/rust/ChangeLog:

* typecheck/rust-casts.cc (TypeCastRules::emit_cast_error):
Refactored ErrorCodes & error messages.

gcc/testsuite/ChangeLog:

* rust/compile/bad_as_bool_char.rs:
Updated comment to pass test case.
* rust/compile/cast1.rs: likewise.
* rust/compile/cast4.rs: likewise.
* rust/compile/cast5.rs: likewise.
* rust/compile/all-cast.rs: New test for all error codes.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
gcc/rust/typecheck/rust-casts.cc
gcc/testsuite/rust/compile/all-cast.rs [new file with mode: 0644]
gcc/testsuite/rust/compile/bad_as_bool_char.rs
gcc/testsuite/rust/compile/cast1.rs
gcc/testsuite/rust/compile/cast4.rs
gcc/testsuite/rust/compile/cast5.rs