]> git.lizzy.rs Git - rust.git/blob - tests/ui/regions/issue-11612.rs
internally change regions to be covariant
[rust.git] / tests / ui / regions / issue-11612.rs
1 // check-pass
2 #![allow(dead_code)]
3 // #11612
4 // We weren't updating the auto adjustments with all the resolved
5 // type information after type check.
6
7 // pretty-expanded FIXME #23616
8
9 trait A { fn dummy(&self) { } }
10
11 struct B<'a, T:'a> {
12     f: &'a T
13 }
14
15 impl<'a, T> A for B<'a, T> {}
16
17 fn foo(_: &dyn A) {}
18
19 fn bar<G>(b: &B<G>) {
20     foo(b);       // Coercion should work
21     foo(b as &dyn A); // Explicit cast should work as well
22 }
23
24 fn main() {}