diff options
author | Emanuele Micheletti <micheletti.emanuele@hotmail.com> | 2023-03-31 12:50:36 +0200 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-04-02 21:08:56 +0000 |
commit | f990f89e90aba1a0123aba9b6cc29827202c2adf (patch) | |
tree | 3e707ff5d3f5a35a2583adf174ca67b4f0d4e2d2 /gcc/rust/ast/rust-ast-tokenstream.cc | |
parent | 1ef39479434ce54879e46926d1ac1c12009c5c07 (diff) | |
download | gcc-f990f89e90aba1a0123aba9b6cc29827202c2adf.zip gcc-f990f89e90aba1a0123aba9b6cc29827202c2adf.tar.gz gcc-f990f89e90aba1a0123aba9b6cc29827202c2adf.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/rust-ast-tokenstream.cc')
0 files changed, 0 insertions, 0 deletions