]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Fix handling of generic arguments for lifetimes only
authorPhilip Herron <herron.philip@googlemail.com>
Wed, 29 Mar 2023 12:35:53 +0000 (13:35 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:28:42 +0000 (18:28 +0100)
commitcb424c7229b688efd11465a8565177810c3fc255
treef39f7bd4db11b85d267ccfdfdad3d15439d31c0d
parent299a2459663eeee17adebb4de9aba44e7014d775
gccrs: Fix handling of generic arguments for lifetimes only

We might have generics that are only for lifetimes this is a bad error
check. We can simply rely on the function to marshall the HIR generics
arguements for the type system to do the error handling for us which will
be more acurate anyway.

Fixes #2043 #2039

gcc/rust/ChangeLog:

* resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit):
add check for reference marker and type's in self params
(ResolveItem::visit): likewise
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path):
remove bad generics check
(TypeCheckExpr::resolve_segments): likewise
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): likewise

gcc/testsuite/ChangeLog:

* rust/compile/const_generics_5.rs: update test case
* rust/compile/issue-2043.rs: New test.
* rust/compile/issue-2039.rs: New test.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/resolve/rust-ast-resolve-item.cc
gcc/rust/typecheck/rust-hir-type-check-path.cc
gcc/rust/typecheck/rust-hir-type-check-type.cc
gcc/testsuite/rust/compile/const_generics_5.rs
gcc/testsuite/rust/compile/issue-2039.rs [new file with mode: 0644]
gcc/testsuite/rust/compile/issue-2043.rs [new file with mode: 0644]