diff options
author | Emanuele Micheletti <micheletti.emanuele@hotmail.com> | 2023-03-31 12:50:36 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 18:28:43 +0100 |
commit | bdb4e2930ecbb96289819833c495ac59214b38b5 (patch) | |
tree | 6640ae414e63722e8e5bf2f0000b8696dd5e78a4 /gcc/rust/ast | |
parent | cb424c7229b688efd11465a8565177810c3fc255 (diff) | |
download | gcc-bdb4e2930ecbb96289819833c495ac59214b38b5.zip gcc-bdb4e2930ecbb96289819833c495ac59214b38b5.tar.gz gcc-bdb4e2930ecbb96289819833c495ac59214b38b5.tar.bz2 |
gccrs: Fix bad cast as a char
In rust cast to char is allowed only from u8 type.
This patch handles fix the case when the type is infered from an integer value,
allowing only the u8 case'
Fixes #2027
gcc/rust/ChangeLog:
* typecheck/rust-casts.cc (TypeCastRules::cast_rules):
case INTEGRAL handles TypeKind::CHAR
gcc/testsuite/ChangeLog:
* rust/compile/cast5.rs: New test.
Signed-off-by: Emanuele Micheletti <micheletti.emanuele@hotmail.com>
Diffstat (limited to 'gcc/rust/ast')
0 files changed, 0 insertions, 0 deletions