mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 19:17:43 +00:00
17 lines
249 B
Rust
17 lines
249 B
Rust
![]() |
trait Foo {
|
||
|
type Assoc;
|
||
|
|
||
|
fn from(s: Self::Assoc) -> Self;
|
||
|
}
|
||
|
|
||
|
struct W<T>(T);
|
||
|
|
||
|
impl<T: Foo> From<[T::Assoc; 1]> for W<T> {
|
||
|
fn from(from: [T::Assoc; 1]) -> Self {
|
||
|
let [item] = from;
|
||
|
W(Foo::from(item))
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fn main() {}
|