Skip to content
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

vector improvements #17920

Merged
merged 3 commits into from
Oct 11, 2014
Merged

vector improvements #17920

merged 3 commits into from
Oct 11, 2014

Conversation

thestinger
Copy link
Contributor

Introduce conversions between Box<[T]> and Vec<T> and use it to reimplement the vec![] macro for efficiency.

@rust-highfive
Copy link
Collaborator

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@thestinger thestinger changed the title Vec vector improvements Oct 10, 2014
@dotdash
Copy link
Contributor

dotdash commented Oct 10, 2014

LGTM

@nikomatsakis
Copy link
Contributor

The changes look good to me modulo wanting to check with process with adding public APIs. The pull request title and description are a bit vague, which (I believe) means that the bors commit will be equally useless. I edited to make them more accurate. Feel free to change it again.

@aturon
Copy link
Member

aturon commented Oct 10, 2014

r=me with #[experimental] added to the new traits and impls. (We can probably stabilize this quickly, though.)

@alexcrichton
Copy link
Member

Would it be possible to have BoxedSlice only imported in the scope of vec! instead of in the prelude for now?

@thestinger
Copy link
Contributor Author

@alexcrichton: Yes, but the into_boxed_slice is already in the prelude since it's not a trait method.

@thestinger
Copy link
Contributor Author

From a stability POV I think it would be better to leave the trait in the prelude and marked experimental when marking the method as unstable/stable, so it could become an inherent method on Box<[T]> eventually.

@alexcrichton
Copy link
Member

Sure, sounds reasonable. In that case the import of use std::slice::BoxedSlice could be removed from the macro as well, right?

@thestinger
Copy link
Contributor Author

@alexcrichton: The use in the macro makes it work in std itself which is nice, although it's unnecessary elsewhere. It saved me trying to track down the incomprehensible errors and adding imports - I should probably file a bug for those... (they do not point to any code using the macro...)

@alexcrichton
Copy link
Member

Ah ok, seems fine

bors added a commit that referenced this pull request Oct 10, 2014
Introduce conversions between `Box<[T]>` and `Vec<T>` and use it to reimplement the `vec![]` macro for efficiency.
@bors bors closed this Oct 11, 2014
@bors bors merged commit 02d976a into rust-lang:master Oct 11, 2014
@thestinger thestinger deleted the vec branch October 11, 2014 09:29
lnicola pushed a commit to lnicola/rust that referenced this pull request Aug 29, 2024
feat: Create an assist to convert closure to freestanding fn

The assist converts all captures to parameters.

Closes rust-lang#17920.

This was more work than I though, since it has to handle a bunch of edge cases...

Based on rust-lang#17941. Needs to merge it first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants