rust/tests/ui/issues/issue-14901.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
312 B
Rust
Raw Normal View History

//@ check-pass
2015-04-10 18:12:43 +00:00
pub trait Reader {}
2014-10-25 22:07:41 +00:00
enum Wrapper<'a> {
2019-05-28 18:46:13 +00:00
WrapReader(&'a (dyn Reader + 'a))
2014-10-25 22:07:41 +00: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 18:46:13 +00:00
Wrapper::WrapReader(self as &'a mut dyn Reader)
2014-10-25 22:07:41 +00:00
}
}
pub fn main() {}