FromZeros boxed slice method supports slice DSTs#1478
Merged
Conversation
a61e5f0 to
35043ae
Compare
35043ae to
ed98c2b
Compare
ed98c2b to
7afe1a0
Compare
7afe1a0 to
5484197
Compare
jswrenn
requested changes
Sep 7, 2024
| } | ||
| } | ||
|
|
||
| /// The error type of a failed allocation. |
Collaborator
There was a problem hiding this comment.
We need to document that this will, in the future, be aliased with core::alloc::AllocError. Otherwise, replacing this type with an alias will be a breaking change.
src/lib.rs
Outdated
| // `Layout::repeat` once it's stabilized. | ||
| let layout = | ||
| Layout::from_size_align(size, align).expect("total allocation size overflows `isize`"); | ||
| let layout = Layout::from_size_align(size, align).map_err(|_| AllocError)?; |
Collaborator
There was a problem hiding this comment.
Suggested change
| let layout = Layout::from_size_align(size, align).map_err(|_| AllocError)?; | |
| let layout = Layout::from_size_align(size, align).unwrap_or(AllocError)?; |
Member
Author
There was a problem hiding this comment.
Done, but used .or instead.
5484197 to
d16421a
Compare
jswrenn
approved these changes
Sep 7, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1478 +/- ##
==========================================
- Coverage 87.83% 87.76% -0.08%
==========================================
Files 15 15
Lines 5623 5638 +15
==========================================
+ Hits 4939 4948 +9
- Misses 684 690 +6 ☔ View full report in Codecov by Sentry. |
d16421a to
72f7c44
Compare
066f9a0 to
9fa6f18
Compare
Change methods that allocate to return a new error, `AllocError`, on allocation failure rather than panicking or aborting. Makes progress on #29
9fa6f18 to
b2aab26
Compare
This was referenced Sep 15, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes progress on #29