mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
19 lines
312 B
Rust
19 lines
312 B
Rust
//@ check-pass
|
|
pub trait Reader {}
|
|
|
|
enum Wrapper<'a> {
|
|
WrapReader(&'a (dyn Reader + 'a))
|
|
}
|
|
|
|
trait Wrap<'a> {
|
|
fn wrap(self) -> Wrapper<'a>;
|
|
}
|
|
|
|
impl<'a, R: Reader> Wrap<'a> for &'a mut R {
|
|
fn wrap(self) -> Wrapper<'a> {
|
|
Wrapper::WrapReader(self as &'a mut dyn Reader)
|
|
}
|
|
}
|
|
|
|
pub fn main() {}
|