-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Create try_new function for ThinBox #110483
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @thomcc (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
@rustbot label +T-libs-api -T-libs |
Changes to unstable APIs require an API Change Proposal, linked in the bot comment |
API change proposal rust-lang/libs-team#213 |
r=me on the impl, but needs api r+ |
I'm going to be away for a few months, so I'm rerolling my PRs so that folks don't have to wait for me. Sorry/thanks. r? libs |
Seems reasonable to me, and I'd approve it, except that there's an open ACP and I don't want to bypass that. r? libs-api |
library/alloc/src/boxed/thin.rs
Outdated
/// #![feature(thin_box)] | ||
/// use std::boxed::ThinBox; | ||
/// | ||
/// let five = ThinBox::new(5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example needs to cover ThinBox::try_new
, not ThinBox::new
.
library/alloc/src/boxed/thin.rs
Outdated
} | ||
|
||
#[unstable(feature = "thin_box", issue = "92791")] | ||
impl<T> ThinBox<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@bors r+ |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#110483 (Create try_new function for ThinBox) - rust-lang#120740 (Make cmath.rs a single file) - rust-lang#120872 (hir: Refactor getters for HIR parents) - rust-lang#120880 (add note on comparing vtables / function pointers) - rust-lang#120885 (interpret/visitor: ensure we only see normalized types) - rust-lang#120888 (assert_unsafe_precondition cleanup) - rust-lang#120897 (Encode `coroutine_for_closure` for foreign crates) - rust-lang#120937 ([docs] Update armv6k-nintendo-3ds platform docs for outdated info) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#110483 - tleibert:thin-box-try-new, r=dtolnay Create try_new function for ThinBox The `allocator_api` feature has proven very useful in my work in the FreeBSD kernel. I've found a few places where a `ThinBox` rust-lang#92791 would be useful, but it must be able to be fallibly allocated for it to be used in the kernel. This PR proposes a change to add such a constructor for ThinBox. ACP: rust-lang/libs-team#213
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#110483 (Create try_new function for ThinBox) - rust-lang#120740 (Make cmath.rs a single file) - rust-lang#120872 (hir: Refactor getters for HIR parents) - rust-lang#120880 (add note on comparing vtables / function pointers) - rust-lang#120885 (interpret/visitor: ensure we only see normalized types) - rust-lang#120888 (assert_unsafe_precondition cleanup) - rust-lang#120897 (Encode `coroutine_for_closure` for foreign crates) - rust-lang#120937 ([docs] Update armv6k-nintendo-3ds platform docs for outdated info) r? `@ghost` `@rustbot` modify labels: rollup
The
allocator_api
feature has proven very useful in my work in the FreeBSD kernel. I've found a few places where aThinBox
#92791 would be useful, but it must be able to be fallibly allocated for it to be used in the kernel.This PR proposes a change to add such a constructor for ThinBox.
ACP: rust-lang/libs-team#213