]> gcc.gnu.org Git - gcc.git/commit
gccrs: handle bare function types with no specified return type
authorPhilip Herron <herron.philip@googlemail.com>
Wed, 29 Mar 2023 15:28:11 +0000 (16:28 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:28:40 +0000 (18:28 +0100)
commitcf311c5324c745e0edde5cd9ed526aea018a169f
tree1eb6ff0a64949ccc9017a6280b50370c424303b6
parente569436fe8c121c031a5ede9b1f952bda61e2393
gccrs: handle bare function types with no specified return type

When we have a function with no return type this defaults to (), but we
need to be sure we generate a new implicit HirId for it otherwise it will
end up in a recursive reference chain.

Fixes #2042

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit):
Add implicit unit type as the return type when not specified

gcc/testsuite/ChangeLog:

* rust/compile/issue-2042.rs: New test.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/typecheck/rust-hir-type-check-type.cc
gcc/testsuite/rust/compile/issue-2042.rs [new file with mode: 0644]
This page took 0.058692 seconds and 5 git commands to generate.