Skip to content

expose drop_in_place as ptr::drop_in_place #27204

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

Closed
wants to merge 2 commits into from

Conversation

Gankra
Copy link
Contributor

@Gankra Gankra commented Jul 21, 2015

This intrinsic is necessary to drop DSTs and should generally be the way to drop memory before manually deallocating it. As such, it should be properly exposed by the standard library.

@rust-highfive
Copy link
Contributor

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

/// # Undefined Behaviour
///
/// This has all the same safety problems as `ptr::read` with respect to
/// invalid pointers, types, and double drops.
Copy link
Member

Choose a reason for hiding this comment

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

extra tabbing in these comments

@alexcrichton alexcrichton added I-needs-decision Issue: In need of a decision. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jul 21, 2015
@Gankra
Copy link
Contributor Author

Gankra commented Jul 29, 2015

The outstanding issue for this is ptr::drop_in_place vs mem::drop_in_place and whether it should take a *mut or an &mut.

mem seems more consistent with mem::drop, but ptr is strictly more flexible (&mut coerces to *mut).

@huonw
Copy link
Member

huonw commented Aug 19, 2015

(This will need a tracking issue and an issue = "..." to land.)

@@ -39,6 +39,9 @@ pub use intrinsics::copy;
#[stable(feature = "rust1", since = "1.0.0")]
pub use intrinsics::write_bytes;

#[unstable(feature = "drop_in_place", reason = "just exposed, needs approval")]
Copy link
Member

Choose a reason for hiding this comment

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

In addition to what @huonw said about this needing issue= now this'll also need to be applied to the definition in the intrinsics module itself to work (we don't look at reexports themselves)

@alexcrichton
Copy link
Member

r=me with @huonw's and my tweaks to the stability attribute

@alexcrichton alexcrichton removed the I-needs-decision Issue: In need of a decision. label Aug 19, 2015
@Gankra Gankra force-pushed the drop-in branch 2 times, most recently from afbe8ec to 46986bf Compare August 19, 2015 21:31
@Gankra
Copy link
Contributor Author

Gankra commented Aug 19, 2015

@bors r=alexcrichton

@bors
Copy link
Collaborator

bors commented Aug 19, 2015

📌 Commit 46986bf has been approved by alexcrichton

@Gankra
Copy link
Contributor Author

Gankra commented Aug 19, 2015

@bors r=alexcrichton

(making the feature gate actually do a thing broke stuff)

@bors
Copy link
Collaborator

bors commented Aug 19, 2015

📌 Commit be29f00 has been approved by alexcrichton

@Gankra
Copy link
Contributor Author

Gankra commented Aug 19, 2015

fsk how did that conflict even happen

@Gankra
Copy link
Contributor Author

Gankra commented Aug 19, 2015

@bors r-

@Gankra
Copy link
Contributor Author

Gankra commented Aug 19, 2015

@bors r=alexcrichton

(This branch was super old, that's how!)

@bors
Copy link
Collaborator

bors commented Aug 19, 2015

📌 Commit 5c6f2c5 has been approved by alexcrichton

@alexcrichton
Copy link
Member

(looks like travis is unhappy)

@Gankra
Copy link
Contributor Author

Gankra commented Aug 19, 2015

augh run-pass test using the intrinsic

@Gankra
Copy link
Contributor Author

Gankra commented Aug 19, 2015

@bors r-

@Gankra
Copy link
Contributor Author

Gankra commented Aug 20, 2015

@bors r=alexcrichton

@bors
Copy link
Collaborator

bors commented Aug 20, 2015

📌 Commit 3547e8c has been approved by alexcrichton

@Gankra
Copy link
Contributor Author

Gankra commented Aug 20, 2015

(actually did a local make-check)

@bors
Copy link
Collaborator

bors commented Aug 21, 2015

⌛ Testing commit 3547e8c with merge 58d247a...

@bors
Copy link
Collaborator

bors commented Aug 21, 2015

💔 Test failed - auto-win-msvc-64-opt

@bors
Copy link
Collaborator

bors commented Sep 11, 2015

☔ The latest upstream changes (presumably #28306) made this pull request unmergeable. Please resolve the merge conflicts.

@apasel422
Copy link
Contributor

What's the status of this?

@Gankra
Copy link
Contributor Author

Gankra commented Oct 28, 2015

@apasel422 I'm kinda AWOL; feel free to rebase if you want this to land!

@apasel422
Copy link
Contributor

Will do!

@Gankra Gankra closed this Oct 28, 2015
bors added a commit that referenced this pull request Oct 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants