Skip to content

Implement From<&mut {slice}> for Box/Rc/Arc<{slice}> - #129329

Merged
bors merged 1 commit into
rust-lang:masterfrom
eduardosm:rc-from-mut-slice
Nov 3, 2024
Merged

bors merged 1 commit into
rust-lang:masterfrom
eduardosm:rc-from-mut-slice

Conversation

@eduardosm

@eduardosm eduardosm commented Aug 20, 2024 •

Copy link
Copy Markdown
Contributor

View all comments

ACP: rust-lang/libs-team#424

New API:

impl<T: Clone> From<&mut [T]> for Box<[T]>
impl From<&mut str> for Box<str>
impl From<&mut CStr> for Box<CStr>
impl From<&mut OsStr> for Box<OsStr>
impl From<&mut Path> for Box<Path>

impl<T: Clone> From<&mut [T]> for Rc<[T]>
impl From<&mut str> for Rc<str>
impl From<&mut CStr> for Rc<CStr>
impl From<&mut OsStr> for Rc<OsStr>
impl From<&mut Path> for Rc<Path>

impl<T: Clone> From<&mut [T]> for Arc<[T]>
impl From<&mut str> for Arc<str>
impl From<&mut CStr> for Arc<CStr>
impl From<&mut OsStr> for Arc<OsStr>
impl From<&mut Path> for Arc<Path>

Since they are trait implementations, I think these are insta-stable.

As mentioned in rust-lang/libs-team#424 (comment), a crater run might be needed.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rc Area: `Rc` and `Arc` disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api [DEPRECATED; DO NOT USE]

Projects

None yet

Development

Successfully merging this pull request may close these issues.