-
Notifications
You must be signed in to change notification settings - Fork 323
Change ArrayBase.ptr to NonNull type #434
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
Comments
Sure, using NonNull should be good for us, don't see a problem with that. We need to remember to highlight the non-null requirement in |
NonNull was already listed over in #414, but I updated it to link to this issue as the specific one for that point. |
(There is no “arbitrary S: Data” yet, because the Data trait is documented to be for our own purpose and we control all its implementations.) |
Specifically, I'm thinking about the raw pointer array views we discussed in #388, for which |
Rust 1.25 introduces a
NonNull
type, which represents a pointer that must always be non-null. It would be nice to switch theArrayBase.ptr
field to typeNonNull<S::Elem>
to indicate that the pointer must always be non-null.However, I'm not quite sure about the implications of
NonNull<T>
being "covariant overT
". After reading this page in the nomicon, I think this is okay forArray
,ArrayView
,ArrayViewMut
, andArcArray
, but I'm not sure that it's okay in general for arbitraryS: Data
.The text was updated successfully, but these errors were encountered: