From c4271707ce700bc87c2772fffa9aa1bc8432c6aa Mon Sep 17 00:00:00 2001 From: Liam Naddell Date: Tue, 17 Dec 2024 11:48:03 -0500 Subject: gccrs: Fix NR2.0 compiler ICE caused by Generics in Enums gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc: Change the late name resolver to enter proper lexical scope during typechecking * resolve/rust-late-name-resolver-2.0.h: Add needed prototype to header * resolve/rust-toplevel-name-resolver-2.0.cc: Add generic parameters to enum's scoped RIB to allow for proper name resolution on types. gcc/testsuite/ChangeLog: * rust/compile/issue-3304.rs: Add small test for generics+enums combination for NR2.0 Signed-off-by: Liam Naddell --- gcc/testsuite/rust/compile/issue-3304.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 gcc/testsuite/rust/compile/issue-3304.rs (limited to 'gcc/testsuite/rust/compile') diff --git a/gcc/testsuite/rust/compile/issue-3304.rs b/gcc/testsuite/rust/compile/issue-3304.rs new file mode 100644 index 0000000..6ab614f --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3304.rs @@ -0,0 +1,10 @@ +// { dg-additional-options "-frust-name-resolution-2.0" } +#[lang = "sized"] +trait Sized {} + +pub enum ROption { + RSome(T), + RNone, +} + +fn main() {} -- cgit v1.1