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 compilation error #410

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Fix compilation error #410

merged 1 commit into from
Jul 30, 2024

Conversation

koutheir
Copy link
Contributor

@koutheir koutheir commented Jul 18, 2024

Use expressions instead of statements when returning the value to the outer scope, and use Option<NonNull<T>> instead of raw pointers because it is safer and still ABI-compatible.

@koutheir
Copy link
Contributor Author

I noticed that there are other places where usage of raw pointers could be replaced by NonNull<T> or Option<NonNull<T>>.

@simonsan
Copy link
Collaborator

@jhwgh1968 If you have any time in between, could you give it a review as well, please? Thank you! 🫂

…`. Both types have the same ABI, but the first one is safer to deal with.
Copy link
Contributor

@jhwgh1968 jhwgh1968 left a comment

Choose a reason for hiding this comment

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

This was written for an older version of Rust based on a project I wrote at the time. In order to compile it, I had to put it "back into the project" it came from.

I have not had to do anything that low level since then, so I don't know if it will work. But at least there is nothing obviously wrong with it.

@simonsan simonsan merged commit ca76f56 into rust-unofficial:main Jul 30, 2024
3 checks passed
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.

3 participants