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 4dbd86aa5d0d..a788a05a71df 100644 --- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc @@ -176,6 +176,16 @@ Late::visit (AST::SelfParam ¶m) param.get_node_id ()); } +void +Late::visit (AST::TypeParam ¶m) +{ + // 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) { 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 59077035ce3c..e74e0de6d8ea 100644 --- a/gcc/rust/resolve/rust-late-name-resolver-2.0.h +++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.h @@ -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; diff --git a/gcc/testsuite/rust/compile/nr2/exclude b/gcc/testsuite/rust/compile/nr2/exclude index 92fa81517da8..5e9a40e1eca6 100644 --- a/gcc/testsuite/rust/compile/nr2/exclude +++ b/gcc/testsuite/rust/compile/nr2/exclude @@ -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 @@ -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 @@ -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 @@ -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