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 b85b6bc619cf..8319a9fe311a 100644 --- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc @@ -164,6 +164,18 @@ Late::visit (AST::IdentifierPattern &identifier) identifier.get_node_id ()); } +void +Late::visit (AST::SelfParam ¶m) +{ + // handle similar to AST::IdentifierPattern + + DefaultResolver::visit (param); + // FIXME: this location should be a bit off + // ex: would point to the begining of "mut self" instead of the "self" + std::ignore = ctx.values.insert (Identifier ("self", param.get_locus ()), + 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 1cdf2ec3f60d..81c3a046bf4f 100644 --- a/gcc/rust/resolve/rust-late-name-resolver-2.0.h +++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.h @@ -41,6 +41,7 @@ class Late : public DefaultResolver // TODO: Do we need this? // void visit (AST::Method &) override; void visit (AST::IdentifierPattern &) override; + void visit (AST::SelfParam &) override; // resolutions void visit (AST::IdentifierExpr &) override; diff --git a/gcc/testsuite/rust/compile/nr2/exclude b/gcc/testsuite/rust/compile/nr2/exclude index f4304dae1d85..b4799edd4f5b 100644 --- a/gcc/testsuite/rust/compile/nr2/exclude +++ b/gcc/testsuite/rust/compile/nr2/exclude @@ -34,7 +34,6 @@ derive_macro6.rs expected_type_args2.rs expected_type_args3.rs feature_rust_attri0.rs -feature_rust_attri1.rs for_lifetimes.rs format_args_basic_expansion.rs generic-default1.rs @@ -54,13 +53,11 @@ infer-crate-name.rs issue-1019.rs issue-1031.rs issue-1034.rs -issue-1128.rs issue-1129-2.rs issue-1130.rs issue-1165.rs issue-1173.rs issue-1235.rs -issue-1237.rs issue-1272.rs issue-1289.rs issue-1447.rs @@ -167,7 +164,6 @@ redef_error2.rs redef_error4.rs redef_error5.rs redef_error6.rs -rustc_attr1.rs self-path1.rs self-path2.rs sizeof-stray-infer-var-bug.rs