diff options
author | Philip Herron <herron.philip@googlemail.com> | 2025-04-16 20:38:17 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2025-04-17 09:28:24 +0000 |
commit | bb01719f0e1665a777b2b475e5feaafd01aa3ac8 (patch) | |
tree | 7ae758403f8689e8f0935541d1f9fb4ced8bc8ae /gcc/rust/ast/rust-expr.h | |
parent | 50a90f12af84ba2d203a0510bbeb41a383981303 (diff) | |
download | gcc-bb01719f0e1665a777b2b475e5feaafd01aa3ac8.zip gcc-bb01719f0e1665a777b2b475e5feaafd01aa3ac8.tar.gz gcc-bb01719f0e1665a777b2b475e5feaafd01aa3ac8.tar.bz2 |
gccrs: Add check for placeholder (infer) type in return position
It is not allowed to have a declared inference variable in the return
position of a function as this may never get infered you need good points
of truth.
Ideally if we get a student for GSoC 25 we will get the Default Hir Visitor
so that we can grab the HIR::InferredType locus instead of using the ref
location lookups.
Fixes Rust-GCC#402
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): add diagnostic
* typecheck/rust-tyty.cc (BaseType::contains_infer): new helper to grab first infer var
* typecheck/rust-tyty.h: prototype
gcc/testsuite/ChangeLog:
* rust/compile/issue-402.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