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

Initial impl of raw_assign_to_drop #13866

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

Conversation

lukaslueg
Copy link
Contributor

Fixes #4294

The lint simply checks all assignments via unsafe pointers where to dereferenced-type has drop-glue.

I'm somewhat unsure about what to call this thing - is it assign_raw_ptr_using_drop, raw_assign_drop, dropped_assign_raw, ... ?

Although some of the tests involve &mut as *mut, the lint does not make efforts to filter out situations where the raw pointer is derived from a known-safe source. The general assumption is that if we have a raw pointer at at all, and assign to the place behind the pointer, then all safety bets are off anyway (otherwise, one could have assigned via &mut to begin with).

changelog: [raw_assign_to_drop]: Initial impl

@rustbot
Copy link
Collaborator

rustbot commented Dec 22, 2024

r? @Centri3

rustbot has assigned @Centri3.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lint suggestion: write to raw pointer with drop glue
3 participants