Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disambiguate generic args during name resolution 2.0 #3200

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

powerboat9
Copy link
Contributor

No description provided.

Comment on lines +266 to +290
Late::visit (AST::GenericArgs &args)
{
for (auto &lifetime : args.get_lifetime_args ())
visit (lifetime);

for (auto &generic : args.get_generic_args ())
visit (generic);

for (auto &binding : args.get_binding_args ())
visit (binding);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't the default visitor already visit generic args ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kind of, from what I can tell GenericArg::accept_vis just visits the properties of GenericArg and there isn't a virtual method for visit (GenericArg &). Therefore, in order to get the GenericArgs visitor to call into the non-virtual GenericArg visitor, the former has to be overridden along with the latter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've rebased and added a comment to the GenericArgs visitor method.

gcc/rust/ChangeLog:

	* resolve/rust-late-name-resolver-2.0.cc
	(Late::visit): Visit GenericArgs and GenericArg, the former
	because the latter involves a non-virtual member function call.
	* resolve/rust-late-name-resolver-2.0.h
	(Late::visit): Likewise.

Signed-off-by: Owen Avery <[email protected]>
@P-E-P P-E-P added this pull request to the merge queue Oct 17, 2024
Merged via the queue into Rust-GCC:master with commit a9931e9 Oct 17, 2024
12 checks passed
@powerboat9 powerboat9 deleted the nr-gen branch October 17, 2024 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants