2019-09-01 16:30:19 -05:00
|
|
|
// check-pass
|
2019-02-25 17:54:49 -06:00
|
|
|
|
|
|
|
pub struct Item {
|
|
|
|
_inner: &'static str,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Bar<T> {
|
|
|
|
items: Vec<Item>,
|
|
|
|
inner: T,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub trait IntoBar<T> {
|
|
|
|
fn into_bar(self) -> Bar<T>;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a, T> IntoBar<T> for &'a str where &'a str: Into<T> {
|
|
|
|
fn into_bar(self) -> Bar<T> {
|
|
|
|
Bar {
|
|
|
|
items: Vec::new(),
|
|
|
|
inner: self.into(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|