-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
impl<T: ?Sized> From<Unique<T>> for NonNull<T> { | ||
#[inline] | ||
fn from(unique: Unique<T>) -> Self { | ||
unsafe { NonNull::new_unchecked(unique.as_ptr()) } |
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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()) } |
There was a problem hiding this comment.
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
.
@bors: r+ |
📌 Commit c2e7eb6 has been approved by |
split core::ptr module into multiple files Cc @Centril
split core::ptr module into multiple files Cc @Centril
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
Cc @Centril