Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Convert Into<Box<[T]>> for Vec<T> into From<Vec<T>> for Box<[T]> #42717

Merged
merged 1 commit into from
Jun 21, 2017

Conversation

ollie27
Copy link
Member

@ollie27 ollie27 commented Jun 17, 2017

As the collections crate has been merged into alloc in #42648 this impl is now possible. This is the final part of #42129 missing from #42227.

@rust-highfive
Copy link
Collaborator

r? @sfackler

(rust_highfive has picked a reviewer for you, use r? to override)

@Mark-Simulacrum
Copy link
Member

Travis failed:

[01:02:51] error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`); only traits defined in the current crate can be implemented for a type parameter
[01:02:51]     --> /checkout/src/liballoc/vec.rs:2128:1
[01:02:51]      |
[01:02:51] 2128 | / impl<T> From<Vec<T>> for Box<[T]> {
[01:02:51] 2129 | |     fn from(v: Vec<T>) -> Box<[T]> {
[01:02:51] 2130 | |         v.into_boxed_slice()
[01:02:51] 2131 | |     }
[01:02:51] 2132 | | }
[01:02:51]      | |_^

@Mark-Simulacrum Mark-Simulacrum added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 17, 2017
@ollie27
Copy link
Member Author

ollie27 commented Jun 17, 2017

Well I didn't expect that. I've added #[cfg(not(test))] like impl<T> From<Box<[T]>> for Vec<T> has which will hopefully fix it.

@tomprince
Copy link
Member

@bors try
Triggering a build to run this through cargobomb.

@bors
Copy link
Contributor

bors commented Jun 17, 2017

⌛ Trying commit 222a328 with merge 5311126...

bors added a commit that referenced this pull request Jun 17, 2017
Convert `Into<Box<[T]>> for Vec<T>` into `From<Vec<T>> for Box<[T]>`

As the `collections` crate has been merged into `alloc` in #42648 this impl is now possible. This is the final part of #42129 missing from #42227.
@bors
Copy link
Contributor

bors commented Jun 17, 2017

☀️ Test successful - status-travis
State: approved= try=True

@sfackler
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jun 20, 2017

📌 Commit 222a328 has been approved by sfackler

@frewsxcv
Copy link
Member

@bors rollup

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Jun 20, 2017
Convert `Into<Box<[T]>> for Vec<T>` into `From<Vec<T>> for Box<[T]>`

As the `collections` crate has been merged into `alloc` in rust-lang#42648 this impl is now possible. This is the final part of rust-lang#42129 missing from rust-lang#42227.
@arielb1 arielb1 added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 20, 2017
bors added a commit that referenced this pull request Jun 20, 2017
Rollup of 6 pull requests

- Successful merges: #42271, #42717, #42728, #42749, #42756, #42772
- Failed merges:
@bors bors merged commit 222a328 into rust-lang:master Jun 21, 2017
@ollie27 ollie27 deleted the into_to_from2 branch June 21, 2017 00:07
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants