Skip to content

nr2.0: Fix resolution of constant items#3841

Merged
P-E-P merged 1 commit into
Rust-GCC:masterfrom
powerboat9:fix-const
Jun 23, 2025
Merged

nr2.0: Fix resolution of constant items#3841
P-E-P merged 1 commit into
Rust-GCC:masterfrom
powerboat9:fix-const

Conversation

@powerboat9

Copy link
Copy Markdown
Collaborator

#3834

Nr2 does handle this and puts out an extra good diagnostic

🙃

gcc/rust/ChangeLog:

	* resolve/rust-default-resolver.cc (DefaultResolver::visit):
	Call DefaultASTVisitor::visit even on ConstantItem instances
	without expressions.

gcc/testsuite/ChangeLog:

	* rust/compile/nr2/exclude: Remove issue-3642.rs.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
void
DefaultResolver::visit (AST::ConstantItem &item)
{
if (item.has_expr ())

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.

dont you still need a has_expr check?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That's the thing -- DefaultASTVisitor handles that

@P-E-P P-E-P added this pull request to the merge queue Jun 23, 2025
Merged via the queue into Rust-GCC:master with commit baa4c42 Jun 23, 2025
12 checks passed
@powerboat9 powerboat9 deleted the fix-const branch June 23, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants