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

NonNull cast should allow ?Sized #91115

Closed
adsnaider opened this issue Nov 21, 2021 · 1 comment
Closed

NonNull cast should allow ?Sized #91115

adsnaider opened this issue Nov 21, 2021 · 1 comment
Labels
C-bug Category: This is a bug.

Comments

@adsnaider
Copy link

Not sure if I should categorize this as a bug since this seems to be something that was overlooked. core::ptr::NonNull has the function pub const fn cast<U>(self) -> NonNull<U> that, as far as I can tell, should allow for U: ?Sized. Am I missing something here?

@adsnaider adsnaider added the C-bug Category: This is a bug. label Nov 21, 2021
@adsnaider
Copy link
Author

I see that #60602 actually explains the reasoning. It would be nice then to have a cast_sliced function that casts NonNull<[T]> to NonNull<[U]>. But since that is a feature request, I think I'll close it here for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

1 participant