Skip to content

Remove usable_size APIs - #69609

Merged
bors merged 1 commit into
rust-lang:masterfrom
TimDiekmann:excess
Mar 3, 2020
Merged

Remove usable_size APIs#69609
bors merged 1 commit into
rust-lang:masterfrom
TimDiekmann:excess

Conversation

@TimDiekmann

Copy link
Copy Markdown
Contributor

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
closesrust-lang/wg-allocators#17

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 1, 2020

@AmanieuAmanieu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc comments for the changed trait methods need to:

  • Explain what the returned usize is and how it is different from layout.size().
  • Say that simply returning layout.size() is enough if your allocator doesn't support this.

Comment threadsrc/libcore/alloc.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this inline when none of the other functions are?

Comment threadsrc/libcore/alloc.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this inline when none of the other functions are?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both cases of #[inline] are no-ops and just return Err.

@TimDiekmann

Copy link
Copy Markdown
ContributorAuthor

I'll add those snippets to the docs. Thanks for reviewing!

@TimDiekmann

Copy link
Copy Markdown
ContributorAuthor
  • Explain what the returned usize is and how it is different from layout.size().

  • Say that simply returning layout.size() is enough if your allocator doesn't support this.

@Amanieu Do you think this should be mentioned on every allocating method or gobally on the trait?

@Amanieu

Copy link
Copy Markdown
Member

I think it should be on all methods.

@rust-highfive

Copy link
Copy Markdown
Contributor

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-03-02T20:16:47.3015407Z ========================== Starting Command Output ===========================
2020-03-02T20:16:47.3018334Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/5971294d-6919-4080-ac50-a819bc5f88f5.sh
2020-03-02T20:16:47.3018730Z 2020-03-02T20:16:47.3024025Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-02T20:16:47.3044334Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/69609/merge to s
2020-03-02T20:16:47.3047203Z Task : Get sources
2020-03-02T20:16:47.3047437Z Description : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-02T20:16:47.3047663Z Version : 1.0.0
2020-03-02T20:16:47.3047890Z Author : Microsoft
---
2020-03-02T20:16:48.5963412Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-02T20:16:48.5970906Z ##[command]git config gc.auto 0
2020-03-02T20:16:48.5995786Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-02T20:16:48.6004214Z ##[command]git config --get-all http.proxy
2020-03-02T20:16:48.6020234Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/69609/merge:refs/remotes/pull/69609/merge

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 @TimNN. (Feature Requests)

Comment threadsrc/libcore/alloc.rs Outdated
Comment threadsrc/libcore/alloc.rs Outdated
Comment threadsrc/libcore/alloc.rs Outdated
Comment threadsrc/libcore/alloc.rs Outdated
Comment threadsrc/libcore/alloc.rs Outdated
@TimDiekmann

TimDiekmann commented Mar 2, 2020

Copy link
Copy Markdown
ContributorAuthor

I have applied your suggestions and squashed the commits.

@Amanieu

Copy link
Copy Markdown
Member

@bors r+ rollup=always

@bors

bors commented Mar 2, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit d8e3557 has been approved by Amanieu

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 2, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 3, 2020
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? @Amanieuclosesrust-lang/wg-allocators#17
bors added a commit that referenced this pull request Mar 3, 2020
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
@JohnTitorJohnTitor mentioned this pull request Mar 3, 2020
bors added a commit that referenced this pull request Mar 3, 2020
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
@bors
bors merged commit 4699b29 into rust-lang:masterMar 3, 2020
@TimDiekmann
TimDiekmann deleted the excess branch March 5, 2020 00:28
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove usable_size APIs

4 participants

@TimDiekmann@Amanieu@rust-highfive@bors