Skip to content

[RFC] Add allocators for zero-copy conversion from Box<T> into Rc<T>#80273

Closed
mahkoh wants to merge 3 commits intorust-lang:masterfrom
mahkoh:zero-copy-rc
Closed

[RFC] Add allocators for zero-copy conversion from Box<T> into Rc<T>#80273
mahkoh wants to merge 3 commits intorust-lang:masterfrom
mahkoh:zero-copy-rc

Conversation

@mahkoh
Copy link
Contributor

@mahkoh mahkoh commented Dec 21, 2020

The motivating example is

let mut vec = Vec::new_in(RcAlloc::new());
file.read_to_end(&mut vec)?;
let rc: Rc<[u8]> = vec.into_boxed_slice().into();

But note that read_to_end does not yet support allocators.

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

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.