Skip to content

nr2.0: Improve visibility path handling #3785

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

powerboat9
Copy link
Collaborator

@powerboat9 powerboat9 commented May 9, 2025

May have some overlap with #3770. Depends on #3784.

gcc/rust/ChangeLog:

	* ast/rust-ast-visitor.cc
	(DefaultASTVisitor::visit): Only visit the path of an instance
	of Visibility if the instance has a path.
	* ast/rust-ast.h
	(SimplePath::SimplePath): Make sure constructors are explicit.
	* resolve/rust-early-name-resolver-2.0.cc
	(Early::visit_attributes): Pass entire paths to
	NameResolutionContext::resolve_path.
	(Early::visit): Likewise and avoid copying a path.
	* resolve/rust-forever-stack.hxx
	(ForeverStack::resolve_path): Assert that at least one path
	segment has been passed in.

Signed-off-by: Owen Avery <[email protected]>
gcc/rust/ChangeLog:

	* resolve/rust-forever-stack.h
	(enum ResolutionMode): New.
	(ForeverStack::get): Add a private overload that takes a
	starting node as a parameter.
	(ForeverStack::resolve_path): Replace boolean parameter
	has_opening_scope_resolution with ResolutionMode parameter mode.
	* resolve/rust-forever-stack.hxx
	(ForeverStack::resolve_path): Likewise.
	(ForeverStack::get): Add a private overload that takes a
	starting node as a parameter.
	* resolve/rust-late-name-resolver-2.0.cc
	(Late::visit): Add Visibility visitor.
	* resolve/rust-late-name-resolver-2.0.h
	(Late::visit): Likewise.
	* resolve/rust-name-resolution-context.h
	(NameResolutionContext::resolve_path): Rework overloading a bit
	and accept ResolutionMode parameter.

gcc/testsuite/ChangeLog:

	* rust/compile/nr2/exclude: Remove entries.

Signed-off-by: Owen Avery <[email protected]>
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.

1 participant