rust/tests/ui/issues/issue-14901.rs
2023-01-11 09:32:08 +00:00

18 lines
311 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() {}