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

allow ptr to int and int to ptr type casting #3321

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

nobel-sh
Copy link
Contributor

No description provided.

@nobel-sh nobel-sh changed the title allowing ptr to int and int to ptr type casting allow ptr to int and int to ptr type casting Dec 22, 2024
Added rules to allow type casting pointer as integer types (u*,i*)
and integer types to be casted as pointer.

gcc/rust/ChangeLog:

	* typecheck/rust-casts.cc (TypeCastRules::cast_rules): Add rule.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Nobel Singh <nobel2073@gmail.com>
Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

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

LGTM nice job

@philberty philberty added this pull request to the merge queue Dec 23, 2024
Merged via the queue into Rust-GCC:master with commit d28cae5 Dec 23, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants