Resolve SelfParam in name resolution 2.0

gcc/rust/ChangeLog:

	* resolve/rust-late-name-resolver-2.0.cc
	(Late::visit): Handle SelfParam.
	* 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 <powerboat9.gamer@gmail.com>
This commit is contained in:
Owen Avery 2024-10-04 12:56:16 -04:00 committed by P-E-P
parent 5ad1d886a9
commit d800490dd9
3 changed files with 13 additions and 4 deletions

View File

@ -164,6 +164,18 @@ Late::visit (AST::IdentifierPattern &identifier)
identifier.get_node_id ());
}
void
Late::visit (AST::SelfParam &param)
{
// 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)
{

View File

@ -41,6 +41,7 @@ public:
// 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;

View File

@ -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