]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-35570.rs
Auto merge of #87150 - rusticstuff:simplify_wrapping_neg, r=m-ou-se
[rust.git] / src / test / ui / issues / issue-35570.rs
1 // check-pass
2
3 use std::mem;
4
5 trait Trait1<T> {}
6 trait Trait2<'a> {
7   type Ty;
8 }
9
10 fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
11     let _e: (usize, usize) = unsafe{mem::transmute(param)};
12 }
13
14 trait Lifetime<'a> {
15     type Out;
16 }
17 impl<'a> Lifetime<'a> for () {
18     type Out = &'a ();
19 }
20 fn foo<'a>(x: &'a ()) -> <() as Lifetime<'a>>::Out {
21     x
22 }
23
24 fn takes_lifetime(_f: for<'a> fn(&'a ()) -> <() as Lifetime<'a>>::Out) {
25 }
26
27 fn main() {
28     takes_lifetime(foo);
29 }