rust/src/test/ui/issues/issue-14901.rs

19 lines
348 B
Rust
Raw Normal View History

// build-pass (FIXME(62277): could be check-pass?)
2015-04-10 13:12:43 -05:00
pub trait Reader {}
2014-10-25 17:07:41 -05:00
enum Wrapper<'a> {
2019-05-28 13:46:13 -05:00
WrapReader(&'a (dyn Reader + 'a))
2014-10-25 17:07:41 -05:00
}
trait Wrap<'a> {
fn wrap(self) -> Wrapper<'a>;
}
impl<'a, R: Reader> Wrap<'a> for &'a mut R {
fn wrap(self) -> Wrapper<'a> {
2019-05-28 13:46:13 -05:00
Wrapper::WrapReader(self as &'a mut dyn Reader)
2014-10-25 17:07:41 -05:00
}
}
pub fn main() {}