diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-14901.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-14901.rs b/src/test/ui/issues/issue-14901.rs new file mode 100644 index 000000000..5319abbdf --- /dev/null +++ b/src/test/ui/issues/issue-14901.rs @@ -0,0 +1,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() {} |