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

Add test for binding name resolution scope #2766

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

P-E-P
Copy link
Member

@P-E-P P-E-P commented Nov 30, 2023

Local variables and functions or global variables have different resolution when binded to a variable. This was not covered before, even though it was handled by the new name resolution. This commit highlight this behavior from the new name resolution mechanism.

Fixes #2730

Local variables and functions or global variables have different
resolution when binded to a variable. This was not covered before, even
though it was handled by the new name resolution. This commit highlight
this behavior from the new name resolution mechanism.

gcc/testsuite/ChangeLog:

	* rust/compile/name_resolution11.rs: New test.
	* rust/compile/name_resolution12.rs: New test.
	* rust/compile/name_resolution13.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
@P-E-P P-E-P added this to the GCC 14.1 release milestone Nov 30, 2023
@P-E-P P-E-P requested a review from CohenArthur November 30, 2023 09:51
@P-E-P P-E-P self-assigned this Nov 30, 2023
We already have some compile tests but it lacked an execution test to
ensure everything compiles correctly to the correct value.

gcc/testsuite/ChangeLog:

	* rust/execute/torture/name_resolution.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
@P-E-P P-E-P marked this pull request as ready for review November 30, 2023 13:13
@P-E-P P-E-P added this pull request to the merge queue Dec 1, 2023
Merged via the queue into Rust-GCC:master with commit e876ff5 Dec 1, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

let bindings can look through function ribs if binding to a function or global
2 participants