summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-14901.rs
blob: 5319abbdf0e5c262a841a7677fc75e29bbc1fb6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// 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() {}