Skip to content

Commit

Permalink
Handle TypeParam in late resolver 2.0
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* resolve/rust-late-name-resolver-2.0.cc
	(Late::visit): Handle TypeParam.
	* 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 Nov 6, 2024
1 parent e82d79c commit 87475b5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
10 changes: 10 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 @@ -176,6 +176,16 @@ Late::visit (AST::SelfParam &param)
param.get_node_id ());
}

void
Late::visit (AST::TypeParam &param)
{
// handle similar to AST::IdentifierPattern but as a type

DefaultResolver::visit (param);
std::ignore
= ctx.types.insert (param.get_type_representation (), param.get_node_id ());
}

void
Late::visit (AST::IdentifierExpr &expr)
{
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 @@ -46,6 +46,7 @@ class Late : public DefaultResolver
// resolutions
void visit (AST::IdentifierExpr &) override;
void visit (AST::PathInExpression &) override;
void visit (AST::TypeParam &) override;
void visit (AST::TypePath &) override;
void visit (AST::StructExprStruct &) override;
void visit (AST::StructExprStructBase &) override;
Expand Down
4 changes: 0 additions & 4 deletions gcc/testsuite/rust/compile/nr2/exclude
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ derive_macro3.rs
derive_macro4.rs
derive_macro6.rs
expected_type_args2.rs
expected_type_args3.rs
feature_rust_attri0.rs
for_lifetimes.rs
format_args_basic_expansion.rs
Expand All @@ -55,7 +54,6 @@ issue-1031.rs
issue-1034.rs
issue-1129-2.rs
issue-1130.rs
issue-1165.rs
issue-1173.rs
issue-1235.rs
issue-1272.rs
Expand Down Expand Up @@ -163,7 +161,6 @@ pub_restricted_3.rs
redef_error2.rs
redef_error4.rs
redef_error5.rs
redef_error6.rs
self-path1.rs
self-path2.rs
sizeof-stray-infer-var-bug.rs
Expand Down Expand Up @@ -222,7 +219,6 @@ if_let_expr_simple.rs
iflet.rs
issue-3033.rs
issue-3009.rs
issue-2323.rs
issue-2953-1.rs
issue-2953-2.rs
# please don't delete the trailing newline

0 comments on commit 87475b5

Please sign in to comment.