]> git.lizzy.rs Git - rust.git/blob - src/test/ui/fn/implied-bounds-unnorm-associated-type-3.rs
Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser
[rust.git] / src / test / ui / fn / implied-bounds-unnorm-associated-type-3.rs
1 // check-pass
2
3 pub trait Yokeable<'a>: 'static {
4     type Output: 'a;
5 }
6
7 impl<'a, T: 'static + ?Sized> Yokeable<'a> for &'static T {
8     type Output = &'a T;
9 }
10
11 pub trait ZeroCopyFrom<C: ?Sized>: for<'a> Yokeable<'a> {
12     /// Clone the cart `C` into a [`Yokeable`] struct, which may retain references into `C`.
13     fn zero_copy_from<'b>(cart: &'b C) -> <Self as Yokeable<'b>>::Output;
14 }
15
16 impl<T> ZeroCopyFrom<[T]> for &'static [T] {
17     fn zero_copy_from<'b>(cart: &'b [T]) -> &'b [T] {
18         cart
19     }
20 }
21
22 fn main() {}