Skip to content

Conversation

tspiteri
Copy link
Contributor

Closes #69316.

@rust-highfive
Copy link
Contributor

r? @dtolnay

(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 Feb 20, 2020
@Centril Centril added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. relnotes Marks issues that should be documented in the release notes of the next release. labels Feb 20, 2020
@Centril Centril added this to the 1.43 milestone Feb 20, 2020
Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

I am not 100% sold on these. Would NonNull::from(slice).cast::<T>() be sufficient for your use case? It looks like that solution was missed in #69316.

@tspiteri
Copy link
Contributor Author

Yes, I had indeed missed that! NonNull::from(slice).cast::<T>() is even already sufficient for another case where I can now get *mut T from &[MaybeUninit<T>] safely.

@tspiteri
Copy link
Contributor Author

tspiteri commented Feb 24, 2020

Further, I'm now realizing this PR would make it necessary to qualify NonNull::from(slice) in the above example into NonNull::<[T]>::from(slice), so it could be doing more harm than good even if, strictly speaking, adding impls is not considered a breaking change.

@tspiteri tspiteri closed this Feb 24, 2020
@Centril Centril removed the relnotes Marks issues that should be documented in the release notes of the next release. label Mar 10, 2020
@Centril Centril removed this from the 1.43 milestone Mar 10, 2020
@tspiteri tspiteri deleted the nonnull_from_slice branch March 13, 2020 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

Feature request: From<&[T]> for NonNull<T>
4 participants