Conversation
Amanieu
left a comment
There was a problem hiding this comment.
The doc comments for the changed trait methods need to:
- Explain what the returned
usizeis and how it is different fromlayout.size(). - Say that simply returning
layout.size()is enough if your allocator doesn't support this.
src/libcore/alloc.rs
Outdated
There was a problem hiding this comment.
Why is this inline when none of the other functions are?
src/libcore/alloc.rs
Outdated
There was a problem hiding this comment.
Why is this inline when none of the other functions are?
There was a problem hiding this comment.
Both cases of #[inline] are no-ops and just return Err.
|
I'll add those snippets to the docs. Thanks for reviewing! |
@Amanieu Do you think this should be mentioned on every allocating method or gobally on the trait? |
|
I think it should be on all methods. |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
I have applied your suggestions and squashed the commits. |
|
@bors r+ rollup=always |
|
📌 Commit d8e3557 has been approved by |
Remove `usable_size` APIs This removes the usable size APIs: - remove `usable_size` (obv) - change return type of allocating methods to include the allocated size - remove `_excess` API r? @Amanieu closes rust-lang/wg-allocators#17
Rollup of 9 pull requests Successful merges: - #69565 (miri engine: turn some debug_assert into assert) - #69609 (Remove `usable_size` APIs) - #69620 (doc(librustc_error_codes): add long error explanation for E0719) - #69626 (Toolstate: don't duplicate nightly tool list.) - #69628 (Fix a leak in `DiagnosticBuilder::into_diagnostic`.) - #69633 (Update my mailmap entry) - #69634 (clean up E0378 explanation) - #69637 (Don't convert Results to Options just for matching.) - #69641 (Update books) Failed merges: r? @ghost
Rollup of 9 pull requests Successful merges: - #69213 (Improve documentation on iterators length) - #69609 (Remove `usable_size` APIs) - #69619 (more cleanups) - #69620 (doc(librustc_error_codes): add long error explanation for E0719) - #69626 (Toolstate: don't duplicate nightly tool list.) - #69628 (Fix a leak in `DiagnosticBuilder::into_diagnostic`.) - #69633 (Update my mailmap entry) - #69634 (clean up E0378 explanation) - #69637 (Don't convert Results to Options just for matching.) Failed merges: r? @ghost
This removes the usable size APIs:
usable_size(obv)_excessAPIr? @Amanieu
closes rust-lang/wg-allocators#17