diff options
Diffstat (limited to 'tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90638.rs')
-rw-r--r-- | tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90638.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90638.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90638.rs new file mode 100644 index 000000000..628b5cba1 --- /dev/null +++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90638.rs @@ -0,0 +1,35 @@ +//check-pass + +trait Yokeable<'a>: 'static { + type Output: 'a; +} + +trait IsCovariant<'a> {} + +struct Yoke<Y: for<'a> Yokeable<'a>> { + data: Y, +} + +impl<Y: for<'a> Yokeable<'a>> Yoke<Y> { + fn project<Y2: for<'a> Yokeable<'a>>(&self, _f: for<'a> fn(<Y as Yokeable<'a>>::Output, &'a ()) + -> <Y2 as Yokeable<'a>>::Output) -> Yoke<Y2> { + + unimplemented!() + } +} + +fn _upcast<Y>(x: Yoke<Y>) -> Yoke<Box<dyn IsCovariant<'static> + 'static>> where + Y: for<'a> Yokeable<'a>, + for<'a> <Y as Yokeable<'a>>::Output: IsCovariant<'a> + { + x.project(|data, _| { + Box::new(data) + }) +} + + +impl<'a> Yokeable<'a> for Box<dyn IsCovariant<'static> + 'static> { + type Output = Box<dyn IsCovariant<'a> + 'a>; +} + +fn main() {} |