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

split core::ptr module into multiple files #61159

Merged
merged 1 commit into from
May 28, 2019
Merged

Conversation

RalfJung
Copy link
Member

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 25, 2019
impl<T: ?Sized> From<Unique<T>> for NonNull<T> {
#[inline]
fn from(unique: Unique<T>) -> Self {
unsafe { NonNull::new_unchecked(unique.as_ptr()) }
Copy link
Member Author

Choose a reason for hiding this comment

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

I had to rewrite this using the public API of Unique.

}

/// Acquires the underlying `*mut` pointer.
#[inline]
Copy link
Member Author

Choose a reason for hiding this comment

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

I made this and the other methods here inline for consistency with NonNull.

impl<'a, T: ?Sized> From<NonNull<T>> for Unique<T> {
#[inline]
fn from(p: NonNull<T>) -> Self {
unsafe { Unique::new_unchecked(p.as_ptr()) }
Copy link
Member Author

Choose a reason for hiding this comment

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

I had to adjust this to use the public API of NonNull.

@clarfonthey
Copy link
Contributor

Glad to see more of these PRs since #42523 and #56932 :p

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented May 28, 2019

📌 Commit c2e7eb6 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 28, 2019
Centril added a commit to Centril/rust that referenced this pull request May 28, 2019
split core::ptr module into multiple files

Cc @Centril
Centril added a commit to Centril/rust that referenced this pull request May 28, 2019
split core::ptr module into multiple files

Cc @Centril
bors added a commit that referenced this pull request May 28, 2019
Rollup of 4 pull requests

Successful merges:

 - #61123 (Allow to specify profiling data output directory as -Zself-profile argument.)
 - #61159 (split core::ptr module into multiple files)
 - #61164 (rename Scalar::Bits to Scalar::Raw and bits field to data)
 - #61250 (Remove special case for *ios* builds in run-make-fulldeps/print-target-list Makefile)

Failed merges:

r? @ghost
@bors bors merged commit c2e7eb6 into rust-lang:master May 28, 2019
@RalfJung RalfJung deleted the ptr branch May 29, 2019 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants