diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-03-29 16:28:11 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 18:28:40 +0100 |
commit | cf311c5324c745e0edde5cd9ed526aea018a169f (patch) | |
tree | 1eb6ff0a64949ccc9017a6280b50370c424303b6 /gcc/rust/ast/rust-ast-dump.h | |
parent | e569436fe8c121c031a5ede9b1f952bda61e2393 (diff) | |
download | gcc-cf311c5324c745e0edde5cd9ed526aea018a169f.zip gcc-cf311c5324c745e0edde5cd9ed526aea018a169f.tar.gz gcc-cf311c5324c745e0edde5cd9ed526aea018a169f.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-ast-dump.h')
0 files changed, 0 insertions, 0 deletions