aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/rust-gcc.cc
diff options
context:
space:
mode:
authorPhilip Herron <herron.philip@googlemail.com>2024-12-02 16:17:54 +0000
committerPhilip Herron <philip.herron@embecosm.com>2024-12-02 17:30:59 +0000
commitdb3d8fb22c8d10a3687742a85de85242a96ac1ba (patch)
treef3d403738882a75b3eb48a8aa6d58eee60eeb890 /gcc/rust/rust-gcc.cc
parentfa93e280ed1c11d9775cb9c3211e13853d39c51c (diff)
downloadgcc-db3d8fb22c8d10a3687742a85de85242a96ac1ba.zip
gcc-db3d8fb22c8d10a3687742a85de85242a96ac1ba.tar.gz
gcc-db3d8fb22c8d10a3687742a85de85242a96ac1ba.tar.bz2
gccrs: constant evaluation like these are coercion sites
The code here was wrongly assuming the decl type from the folding of the expression would be the type of the constant decl. This is not the case for unsized coercions for slices, where the expression here is a reference to an array then we require the coercion to fix the result up to the expected type. Fixes Rust-GCC#1525 gcc/rust/ChangeLog: * backend/rust-compile-base.cc: apply coercion site to result * backend/rust-compile-base.h: update prototype * backend/rust-compile-implitem.cc (CompileTraitItem::visit): send in coercion info * backend/rust-compile-item.cc (CompileItem::visit): likewise gcc/testsuite/ChangeLog: * rust/compile/issue-1525.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust/rust-gcc.cc')
0 files changed, 0 insertions, 0 deletions