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

Resolve lang-item PathInExpressions in nr2.0 late resolver #3404

Merged

Conversation

CohenArthur
Copy link
Member

Needs #3094 so only review the last commit

@liamnaddell @powerboat9 how does that look to you?

Copy link
Contributor

@liamnaddell liamnaddell left a comment

Choose a reason for hiding this comment

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

LGTM

Definition (Analysis::Mappings::get ().get_lang_item_node (
expr.get_lang_item ())));
return;
}

auto resolved
= ctx.values.resolve_path (expr.get_segments ()).or_else ([&] () {
Copy link
Contributor

Choose a reason for hiding this comment

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

When I was looking at this code, I got lost trying to figure out what resolve_path does, and how forever stacks work, and missed that the important part was calling map_usage.

Copy link
Member Author

Choose a reason for hiding this comment

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

no worries it's all good :) dealing with the macro expansion is already complex enough for one PR haha

gcc/rust/ChangeLog:

	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Special case lang item paths.
@CohenArthur CohenArthur force-pushed the nr2.0-lang-item-pathinexprs branch from 804009d to 991e72c Compare January 31, 2025 16:42
Copy link
Collaborator

@powerboat9 powerboat9 left a comment

Choose a reason for hiding this comment

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

LGTM

@CohenArthur CohenArthur added this pull request to the merge queue Feb 2, 2025
Merged via the queue into Rust-GCC:master with commit adf6afb Feb 2, 2025
12 checks passed
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.

3 participants