-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Stabilize try_reserve #87993
Stabilize try_reserve #87993
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
414410e
to
4ad86b6
Compare
cc @rust-lang/wg-allocators |
☔ The latest upstream changes (presumably #86860) made this pull request unmergeable. Please resolve the merge conflicts. |
r? @joshtriplett perhaps, not sure what current T-libs FCP practice is. I don't think I see a completed one though. |
FCP for stabilization: |
Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
@rfcbot concern need |
@dtolnay Thanks for catching that. I don't think we need that |
Don't stabilize creation of TryReserveError instances rust-lang#48043 + rust-lang#87993 (comment)
Don't stabilize creation of TryReserveError instances rust-lang#48043 + rust-lang#87993 (comment)
Don't stabilize creation of TryReserveError instances rust-lang#48043 + rust-lang#87993 (comment)
@rfcbot resolve need |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Don't stabilize creation of TryReserveError instances rust-lang#48043 + rust-lang#87993 (comment)
📌 Commit 00152d8 has been approved by |
🌲 The tree is currently closed for pull requests below priority 4. This pull request will be tested once the tree is reopened. |
…htriplett Stabilize try_reserve Stabilization PR for the [`try_reserve` feature](rust-lang#48043 (comment)).
…htriplett Stabilize try_reserve Stabilization PR for the [`try_reserve` feature](rust-lang#48043 (comment)).
…htriplett Stabilize try_reserve Stabilization PR for the [`try_reserve` feature](rust-lang#48043 (comment)).
…ingjubilee Rollup of 15 pull requests Successful merges: - rust-lang#87993 (Stabilize try_reserve) - rust-lang#88090 (Perform type inference in range pattern) - rust-lang#88780 (Added abs_diff for integer types.) - rust-lang#89270 (path.push() should work as expected on windows verbatim paths) - rust-lang#89413 (Correctly handle supertraits for min_specialization) - rust-lang#89456 (Update to the final LLVM 13.0.0 release) - rust-lang#89466 (Fix bug with query modifier parsing) - rust-lang#89473 (Fix extra `non_snake_case` warning for shorthand field bindings) - rust-lang#89474 (rustdoc: Improve doctest pass's name and module's name) - rust-lang#89478 (Fixed numerus of error message) - rust-lang#89480 (Add test for issue 89118.) - rust-lang#89487 (Try to recover from a `=>` -> `=` or `->` typo in a match arm) - rust-lang#89494 (Deny `where` clauses on `auto` traits) - rust-lang#89511 (:arrow_up: rust-analyzer) - rust-lang#89536 (update Miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Why wasn't the actual error kind stabilized? There's no point to this feature without the ability to introspect. |
@LeonineKing1199 You can see in the original RFC discussion that it wasn't certain if the error should be stabilized exactly as it is implemented currently, with separate cases that just mirror an inconsistency in std (where some allocation failures panic, and some abort). Waiting for resolution of that question was delaying stabilization of the entire feature. I'm interested to hear what is your use-case and what data you'd like to get out of the error type, to help guide how the error type should be designed. |
Ha ha, looks like my case was already addressed:
It is for implementing the stdlib APIs without polluting it with polyfills that are incompatible with what's in the stdlib. |
Great. So you're not looking to get any data out of it yourself, you just want to return a For now a hacky way to get some instance is |
In my opinion, the error is more for the end user, or very special case for something like kernel linux. For a server I will log the error and continue anyway so don't really care, even if I would consider a @kornelski Do you think we could have const value |
Actually, this would work perfectly! |
…, r=yaahc add BinaryHeap::try_reserve and BinaryHeap::try_reserve_exact `try_reserve` of many collections were stablized in rust-lang#87993 in 1.57.0. Add `try_reserve` for the rest collections such as `BinaryHeap` should be not controversial.
…, r=yaahc add BinaryHeap::try_reserve and BinaryHeap::try_reserve_exact `try_reserve` of many collections were stablized in rust-lang#87993 in 1.57.0. Add `try_reserve` for the rest collections such as `BinaryHeap` should be not controversial.
Stabilization PR for the
try_reserve
feature.