Skip to content

Limit globbing visitor#4569

Merged
CohenArthur merged 1 commit into
Rust-GCC:masterfrom
powerboat9:fix-glob
Jun 2, 2026
Merged

Limit globbing visitor#4569
CohenArthur merged 1 commit into
Rust-GCC:masterfrom
powerboat9:fix-glob

Conversation

@powerboat9

Copy link
Copy Markdown
Collaborator

The globbing visitor would previously descend into some kinds of rust item, instead of registering them as glob imports or ignoring them. This would cause items nested in those items to be glob imported, despite them not being top level items inside the glob container.

Kudos to @CohenArthur for finding this bug.

The globbing visitor would previously descend into some kinds of rust
item, instead of registering them as glob imports or ignoring them. This
would cause items nested in those items to be glob imported, despite
them not being top level items inside the glob container.

gcc/rust/ChangeLog:

	* resolve/rust-finalize-imports-2.0.cc (GlobbingVisitor::visit):
	Add overrides for more items.
	* resolve/rust-finalize-imports-2.0.h (GlobbingVisitor::visit):
	Likewise.

gcc/testsuite/ChangeLog:

	* rust/compile/name_resolution27.rs: New test.

Reported-by: Arthur Cohen <arthur.cohen@embecosm.com>
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>

@CohenArthur CohenArthur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

well done on the fix! thanks!

@CohenArthur

Copy link
Copy Markdown
Member

Tested on my branch with core and it does fix the issue I had found, thanks @powerboat9

@CohenArthur CohenArthur added this pull request to the merge queue Jun 2, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 2, 2026
@CohenArthur CohenArthur added this pull request to the merge queue Jun 2, 2026
Merged via the queue into Rust-GCC:master with commit cd9103f Jun 2, 2026
12 checks passed
@powerboat9 powerboat9 deleted the fix-glob branch June 3, 2026 00:37
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