diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-03-29 16:28:11 +0100 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2023-03-30 15:17:53 +0100 |
commit | 98735d4fe7f435170d0bbc3e5f8bee0702afe464 (patch) | |
tree | 12e069c2e44f039a246f87e06178e9efb0c34147 /gcc/rust/ast/rust-expr.h | |
parent | ea9ae4044000496714d3f0c58f3dba21487247ac (diff) | |
download | gcc-98735d4fe7f435170d0bbc3e5f8bee0702afe464.zip gcc-98735d4fe7f435170d0bbc3e5f8bee0702afe464.tar.gz gcc-98735d4fe7f435170d0bbc3e5f8bee0702afe464.tar.bz2 |
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>
Diffstat (limited to 'gcc/rust/ast/rust-expr.h')
0 files changed, 0 insertions, 0 deletions