]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Fix ICE by adding check for enum candidate's in TypePath resolution
authorPhilip Herron <herron.philip@googlemail.com>
Sun, 30 Jul 2023 17:59:06 +0000 (18:59 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:56:04 +0000 (18:56 +0100)
commit432cdee6a6e28c52dae6b69079db301b9681485b
treef0a901ea95676be8e50c051af2df558d3adaeeae
parentf7b2e17682b5139a08f7956226bf7ccbdec88230
gccrs: Fix ICE by adding check for enum candidate's in TypePath resolution

Fixes #2479

gcc/rust/ChangeLog:

* typecheck/rust-hir-trait-resolve.cc (TraitItemReference::resolve_item):
always resolve the type even when its an a mandatory trait item
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path):
Add check for enum candidates otherwise you get undefined behaviour

gcc/testsuite/ChangeLog:

* rust/compile/issue-2479.rs: New test.

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