Skip to content

Commit

Permalink
Handle TypeAlias during toplevel resolution 2.0
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* resolve/rust-toplevel-name-resolver-2.0.cc
	(TopLevel::visit): Handle TypeAlias.
	* resolve/rust-toplevel-name-resolver-2.0.h
	(TopLevel::visit): Likewise.

gcc/testsuite/ChangeLog:

	* rust/compile/nr2/exclude: Remove type-alias1.rs.

Signed-off-by: Owen Avery <[email protected]>
  • Loading branch information
powerboat9 authored and P-E-P committed Oct 10, 2024
1 parent 1a030d3 commit 3bff5cf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
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 @@ -348,6 +348,15 @@ TopLevel::visit (AST::ConstantItem &const_item)
DefaultResolver::visit (const_item);
}

void
TopLevel::visit (AST::TypeAlias &type_item)
{
insert_or_error_out (type_item.get_new_type_name (), type_item,
Namespace::Types);

DefaultResolver::visit (type_item);
}

static void
flatten_rebind (
const AST::UseTreeRebind &glob,
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 @@ -161,6 +161,7 @@ class TopLevel : public DefaultResolver
void visit (AST::Enum &enum_item) override;
void visit (AST::Union &union_item) override;
void visit (AST::ConstantItem &const_item) override;
void visit (AST::TypeAlias &type_item) override;
void visit (AST::ExternCrate &crate) override;
void visit (AST::TypeParam &type_param) override;

Expand Down
1 change: 0 additions & 1 deletion gcc/testsuite/rust/compile/nr2/exclude
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ traits7.rs
traits8.rs
traits9.rs
tuple_struct1.rs
type-alias1.rs
type-bindings1.rs
unconstrained_type_param.rs
undeclared_label.rs
Expand Down

0 comments on commit 3bff5cf

Please sign in to comment.