Skip to content

Commit

Permalink
Auto merge of #47299 - cramertj:unsafe-placer, r=alexcrichton
Browse files Browse the repository at this point in the history
Make core::ops::Place an unsafe trait

Consumers of `Place` would reasonably expect that the `pointer` function returns a valid pointer to memory that can actually be written to.
  • Loading branch information
bors committed Jan 24, 2018
2 parents 9276182 + 6969c3f commit 4a82c56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1972,7 +1972,7 @@ impl<'a, K, V> Placer<V> for Entry<'a, K, V> {
#[unstable(feature = "collection_placement",
reason = "placement protocol is subject to change",
issue = "30172")]
impl<'a, K, V> Place<V> for EntryPlace<'a, K, V> {
unsafe impl<'a, K, V> Place<V> for EntryPlace<'a, K, V> {
fn pointer(&mut self) -> *mut V {
self.bucket.read_mut().1
}
Expand Down

0 comments on commit 4a82c56

Please sign in to comment.