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

Fix modules with same name as builtins causing ICE (#3315) #3437

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liamnaddell
Copy link
Contributor

@liamnaddell liamnaddell commented Feb 14, 2025

@powerboat9 I can update to move the language prelude to rust-forever-stack.hxx soon

gcc/rust/ChangeLog:

	* resolve/rust-forever-stack.h: Add a dedicated prelude node for the Language prelude
	* resolve/rust-forever-stack.hxx: Add support code for the prelude node
	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Move language prelude builtins to the prelude context
	* resolve/rust-name-resolution-context.cc: Add code for handling the prelude corner case
	* resolve/rust-rib.h: Add a special Prelude rib type

gcc/testsuite/ChangeLog:

	* rust/compile/issue-3315-1.rs: Add test for module with same name as builtin
	* rust/compile/issue-3315-2.rs: Test with utilization of i32 type
	* rust/compile/nr2/exclude: issue-3315-2.rs Does not work with NR2.0

Thank you for making Rust GCC better!

If your PR fixes an issue, you can add "Fixes #issue_number" into this
PR description and the git commit message. This way the issue will be
automatically closed when your PR is merged. If your change addresses
an issue but does not fully fix it please mark it as "Addresses #issue_number"
in the git commit message.

Here is a checklist to help you with your PR.

Note that you can skip the above if you are just opening a WIP PR in
order to get feedback.

*Please write a comment explaining your change. This is the message
that will be part of the merge commit.

@liamnaddell liamnaddell force-pushed the modname branch 3 times, most recently from fdb1561 to 484b8d3 Compare February 14, 2025 04:26
gcc/rust/ChangeLog:

	* resolve/rust-forever-stack.h: Add a dedicated prelude node for
	the Language prelude
	* resolve/rust-forever-stack.hxx: Add support code for the
	prelude node
	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Move
	language prelude builtins to the prelude context
	* resolve/rust-name-resolution-context.cc: Add code for handling
	the prelude corner case
	* resolve/rust-rib.h: Add a special Prelude rib type

gcc/testsuite/ChangeLog:

	* rust/compile/issue-3315-1.rs: Add test for module with same name
	as builtin
	* rust/compile/issue-3315-2.rs: Test with utilization of i32
	type
	* rust/compile/nr2/exclude: issue-3315-2.rs Does not work with
	NR2.0

Signed-off-by: Liam Naddell <[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