Closed
Description
Lines 226 to 231 in 7069695
This code takes &mut Self
, which itself contains an &mut [T]
, and runs drop glue for the elements in the slice.
While ptr::drop_in_place()
does not explicitly say that the resultant value is invalid, it says it is "invalid to read". My understanding of the Rust unsafe model is that it is UB to have a live reference to a type that is invalid to read, in this case we are violating the validity constraints of &mut [T]
, which in turn violates validity of &mut Self
.
The type does come from ManuallyDrop
, but it's still UB to invalidate that whilst it has live references to it.
I think this should probably be a raw pointer + phantomdata?
Metadata
Metadata
Assignees
Labels
No labels