]>
Commit | Line | Data |
---|---|---|
e1599b0c | 1 | // check-pass |
532ac7d7 XL |
2 | |
3 | pub struct Bar<T> { | |
4 | items: Vec<&'static str>, | |
5 | inner: T, | |
6 | } | |
7 | ||
8 | pub trait IntoBar<T> { | |
9 | fn into_bar(self) -> Bar<T>; | |
10 | } | |
11 | ||
12 | impl<'a, T> IntoBar<T> for &'a str where &'a str: Into<T> { | |
13 | fn into_bar(self) -> Bar<T> { | |
14 | Bar { | |
15 | items: Vec::new(), | |
16 | inner: self.into(), | |
17 | } | |
18 | } | |
19 | } | |
20 | ||
21 | fn main() {} |