]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Add missing coercion site logic to return expressions
authorPhilip Herron <herron.philip@googlemail.com>
Tue, 9 May 2023 14:59:46 +0000 (15:59 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:37:15 +0000 (18:37 +0100)
commitb90dc2bdd23127ab998f352eaa592d7d052d8d64
tree56faa326bdfb5ac73a89bf89e1ec18db9b5a3bb1
parentf91d7d39067de97adb5c67f052daa2dcd27f3cc6
gccrs: Add missing coercion site logic to return expressions

gcc/rust/ChangeLog:

* backend/rust-compile-base.cc: track return type in fncontext
* backend/rust-compile-context.h (struct fncontext): likewise
* backend/rust-compile-expr.cc (CompileExpr::visit): apply coercion site
(CompileExpr::generate_closure_function): update push_context
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): likewise

gcc/testsuite/ChangeLog:

* rust/execute/torture/coercion3.rs: New test.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/backend/rust-compile-base.cc
gcc/rust/backend/rust-compile-context.h
gcc/rust/backend/rust-compile-expr.cc
gcc/rust/typecheck/rust-hir-type-check-expr.cc
gcc/testsuite/rust/execute/torture/coercion3.rs [new file with mode: 0644]