Skip to content

Don't hide unsafety in $ptr argument of container_of! #473

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

Merged
merged 1 commit into from
Jul 31, 2021

Conversation

LeSeulArtichaut
Copy link

By evaluating $ptr outside of the macro's unsafe block, it is up to the caller to wrap any unsafe code needed to evaluate the pointer in an unsafe block and provide a SAFETY explanation.

Helps with #351.

Signed-off-by: Léo Lanteri Thauvin [email protected]

By evaluating `$ptr` outside of the macro's `unsafe` block, it is up to
the caller to wrap any `unsafe` code needed to evaluate the pointer in
an `unsafe` block and provide a `SAFETY` explanation.

Signed-off-by: Léo Lanteri Thauvin <[email protected]>
@ojeda
Copy link
Member

ojeda commented Jul 31, 2021

LGTM

@ojeda ojeda merged commit a033825 into Rust-for-Linux:rust Jul 31, 2021
@LeSeulArtichaut LeSeulArtichaut deleted the unsafe-ptr-container-of branch July 31, 2021 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants