From 98dc9b9937efa8cb9114d96cd43497420e834d62 Mon Sep 17 00:00:00 2001 From: Owen Avery Date: Thu, 17 Oct 2024 01:23:11 -0400 Subject: [PATCH] nr2.0: Resolve type aliases inside trait definitions gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add visitor for TraitItemType. * resolve/rust-late-name-resolver-2.0.h (Late::visit): Likewise. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove entries. Signed-off-by: Owen Avery --- gcc/rust/resolve/rust-late-name-resolver-2.0.cc | 9 +++++++++ gcc/rust/resolve/rust-late-name-resolver-2.0.h | 1 + gcc/testsuite/rust/compile/nr2/exclude | 5 ----- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc index 4f967a71b7d..4a37397eb3e 100644 --- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc @@ -300,6 +300,15 @@ Late::visit (AST::Trait &trait) DefaultResolver::visit (trait); } +void +Late::visit (AST::TraitItemType &trait_item) +{ + std::ignore = ctx.types.insert (trait_item.get_identifier (), + trait_item.get_node_id ()); + + DefaultResolver::visit (trait_item); +} + void Late::visit (AST::StructStruct &s) { diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.h b/gcc/rust/resolve/rust-late-name-resolver-2.0.h index 0db21f2a0bd..59881fc8f3c 100644 --- a/gcc/rust/resolve/rust-late-name-resolver-2.0.h +++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.h @@ -49,6 +49,7 @@ class Late : public DefaultResolver void visit (AST::LangItemPath &) override; void visit (AST::TypePath &) override; void visit (AST::Trait &) override; + void visit (AST::TraitItemType &) override; void visit (AST::StructExprStruct &) override; void visit (AST::StructExprStructBase &) override; void visit (AST::StructExprStructFields &) override; diff --git a/gcc/testsuite/rust/compile/nr2/exclude b/gcc/testsuite/rust/compile/nr2/exclude index 3a82d1ca900..9d68a453ab9 100644 --- a/gcc/testsuite/rust/compile/nr2/exclude +++ b/gcc/testsuite/rust/compile/nr2/exclude @@ -74,8 +74,6 @@ issue-2139.rs issue-2142.rs issue-2165.rs issue-2166.rs -issue-2190-1.rs -issue-2190-2.rs issue-2238.rs issue-2304.rs issue-2330.rs @@ -85,7 +83,6 @@ issue-2723-1.rs issue-2723-2.rs issue-2772-2.rs issue-2775.rs -issue-2747.rs issue-2782.rs issue-2812.rs issue-850.rs @@ -98,7 +95,6 @@ macros/mbe/macro-issue1233.rs macros/mbe/macro-issue1400.rs macros/mbe/macro13.rs macros/mbe/macro15.rs -macros/mbe/macro20.rs macros/mbe/macro23.rs macros/mbe/macro40.rs macros/mbe/macro43.rs @@ -198,7 +194,6 @@ iflet.rs issue-3033.rs issue-3009.rs issue-2323.rs -issue-2953-1.rs issue-2953-2.rs issue-1773.rs issue-2905-1.rs