Skip to content

Commit

Permalink
nr2.0: Resolve type aliases inside trait definitions
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
powerboat9 committed Dec 28, 2024
1 parent a829dff commit 98dc9b9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 9 additions & 0 deletions gcc/rust/resolve/rust-late-name-resolver-2.0.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions gcc/rust/resolve/rust-late-name-resolver-2.0.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions gcc/testsuite/rust/compile/nr2/exclude
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 98dc9b9

Please sign in to comment.