-
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
Tracking issue for From<&[T]> for Rc
& co
#40475
Comments
Anyone willing to implement this? |
@alexbool Sure, I just need to get started with and learn how to contribute to the compiler / stdlib. I'll ask for some help on #rust-internals. |
I see it's been quiet here for a couple of months, so I thought I would try implementing this myself and I ran into an issue in the process:
I'm unsure how to proceed. A few options are immediately apparent to me:
|
@murarth Apologies for my tardiness.
This should be backwards compatible since |
In that case what’s the point of having separating |
@SimonSapin It can be argued that Regarding the other choices,
Actually... I change my mind... Moving |
Or, move all of |
@SimonSapin Hmm... Wouldn't some developers for the embedded domain want the remaining stuff in @japaric ^ |
I'm leaning toward the first option (spinning |
@Centril I'm probably not the best person to ask about this because although I do embedded Rust development I try to avoid using dynamic memory allocation as much as possible.
This is the other reason why I avoid any no_std crate that's not core. As for the actual question: I wouldn't mind if collections was merged into alloc and see no downside in merging them other than increased compilation time if you only wanted the stuff that's currently in the alloc crate. (Personally I'm more of a fan of having more crates rather than less.) |
One thing that could potentially be useful in the future is adding implementations to create |
Can we just implement the |
It’s already implemented. It needs to be exposed in a public API. https://github.com/rust-lang/rust/blob/1.18.0/src/liballoc/rc.rs#L402-L457 |
Although it’s from |
Implement From<&[T]> and others for Arc/Rc (RFC 1845) * Implements `From<`{`&[T]`, `&str`, `String`, `Box<T> where T: ?Sized`, `Vec<T>`}`>` for `Arc`/`Rc` * Removes `rustc_private`-marked methods `Rc::__from_array` and `Rc::__from_str`, replacing their use with `Rc::from` Tracking issue: #40475
Huzzah, the implementation PR #42565 has been merged! The |
Indeed this can be stable now, thanks again for sticking with this @murarth! |
Tracking issue for rust-lang/rfcs#1845
The text was updated successfully, but these errors were encountered: