Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upNew modifications #155
New modifications #155
Conversation
c2acd16
to
0865b42
|
Could you please redo these changes so there's a separate commit for each of the points you mentioned? This is really difficult to review in its current condition. |
aa1a49c
to
a797f80
|
@jdm Sure |
lib.rs: Alloc feature Cargo.toml: New features and 2018 edition
| @@ -258,25 +258,25 @@ impl<A: Array> SmallVecData<A> { | |||
| #[inline] | |||
| unsafe fn inline(&self) -> &A { | |||
| match *self { | |||
| SmallVecData::Inline(ref a) => a, | |||
| SmallVecData::Inline(ref a) => &*a.as_ptr(), | |||
This comment has been minimized.
This comment has been minimized.
mbrubeck
Jun 19, 2019
Contributor
I believe it's unsound to return an &A that points to a possibly-uninitialized A. This method should be changed to return a raw pointer. (The callers of this method only need raw pointers anyways.)
| _ => debug_unreachable!(), | ||
| } | ||
| } | ||
| #[inline] | ||
| unsafe fn inline_mut(&mut self) -> &mut A { | ||
| match *self { | ||
| SmallVecData::Inline(ref mut a) => a, | ||
| SmallVecData::Inline(ref mut a) => &mut *a.as_mut_ptr(), |
This comment has been minimized.
This comment has been minimized.
mbrubeck
Jun 19, 2019
Contributor
Like inline above, this method should be changed to return a raw pointer.
|
Thanks @mbrubeck |
|
Can I squash commits? |
|
@SimonSapin How does this work relate to #157? |
|
I haven’t looked at the diff, but based on the description a lot of it is similar or equivalent. Only with a different approach: incremental changes v.s. rewrite. |
|
Based on this current work, I can apply @SimonSapin modifications in future PRs |
|
The const_generics feature is now fully functional. Is anything preventing this PR from being merged? |
|
While experimenting with const generics in a branch is fine, I would prefer not to have them in the
I realize this is not exactly what you meant, but that’s an overstatement. Using |
I am sorry for the misunderstanding. Early versions of this PR contained a non-functional implementation for constant generics and it is now properly fixed.
It is the own nature of unstable Rustc features to break existing code in future releases, the same reason can be applied to already included unstable features of Nevertheless, if you guys feel comfortable enough to merge this code without constant generics, I can extract it into a separate PR. |
|
|
|
|
I think most of this stuff has landed already incrementally... Should this be closed? |
|
(Like, constant generics and other improvements are still welcome I guess, but this PR as is is pretty unlikely to land) |
|
I cherry-picked and landed some of the changes from this that weren't covered by other PRs. I'm closing this now but feel free to open new PRs for any remaining changes. Smaller, incremental patches are appreciated if possible. Thanks! |
c410-f3r commentedJun 15, 2019
•
edited
Fixes #154 and some other things.
allocfeature and doesn't remove thestdfeature because ofstd::io::Write.mem::uninitializedwithMaybeUninit.NonNull<T>instead of*mut T.VecLike.core::hint::unreachable_uncheckedinstead ofunchecked.lib.rsfile into smaller modules for better readability, localization and maintainability.1.36.2018epochversion.This change is