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-toplevel-name-resolver-2.0.cc
	(TopLevel::visit): Add visitor for TraitItemType.
	* resolve/rust-toplevel-name-resolver-2.0.h
	(TopLevel::visit): Likewise.

gcc/testsuite/ChangeLog:

	* rust/compile/nr2/exclude: Remove entries.

Signed-off-by: Owen Avery <[email protected]>
  • Loading branch information
powerboat9 committed Jan 2, 2025
1 parent db11825 commit 5b35fc7
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-toplevel-name-resolver-2.0.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ TopLevel::visit (AST::Trait &trait)
DefaultResolver::visit (trait);
}

void
TopLevel::visit (AST::TraitItemType &trait_item)
{
insert_or_error_out (trait_item.get_identifier ().as_string (), trait_item,
Namespace::Types);

DefaultResolver::visit (trait_item);
}

template <typename PROC_MACRO>
static void
insert_macros (std::vector<PROC_MACRO> &macros, NameResolutionContext &ctx)
Expand Down
1 change: 1 addition & 0 deletions gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ class TopLevel : public DefaultResolver

void visit (AST::Module &module) override;
void visit (AST::Trait &trait) override;
void visit (AST::TraitItemType &trait_item) override;
void visit (AST::MacroRulesDefinition &macro) override;
void visit (AST::Function &function) override;
void visit (AST::BlockExpr &expr) 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 5b35fc7

Please sign in to comment.