mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-24 14:34:23 +00:00
22 lines
344 B
Rust
22 lines
344 B
Rust
// check-pass
|
|
|
|
pub struct Bar<T> {
|
|
items: Vec<&'static str>,
|
|
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() {}
|