]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Fix compilation of types which hold onto dangling infer vars
authorPhilip Herron <herron.philip@googlemail.com>
Mon, 21 Aug 2023 11:35:26 +0000 (12:35 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:00:33 +0000 (19:00 +0100)
commit6505e466507a6635f9fe1a7ed38d9b6e6cad1737
treef0e7951cd7d4bacdc8db106800e3a269825294ef
parentc7c9bbaa1a12c47ccd6e6c13cca6161e59f4fa5c
gccrs: Fix compilation of types which hold onto dangling infer vars

There is a case where some generic types are holding onto inference
variable pointers directly. So this gives the backend a chance to do one
final lookup to resolve the type.

This now allows us to compile a full test case for iterators but there is
still one miscompilation in here which results in a segv on O2 and bad
result on -O0.

Addresses #1895

gcc/rust/ChangeLog:

* backend/rust-compile-type.cc (TyTyResolveCompile::visit): do a final lookup

gcc/testsuite/ChangeLog:

* rust/compile/iterators1.rs: New test.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/backend/rust-compile-type.cc
gcc/testsuite/rust/compile/iterators1.rs [new file with mode: 0644]