]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-11612.rs
Auto merge of #57108 - Mark-Simulacrum:license-remove, r=pietroalbini
[rust.git] / src / test / ui / issues / issue-11612.rs
1 // compile-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(_: &A) {}
18
19 fn bar<G>(b: &B<G>) {
20     foo(b);       // Coercion should work
21     foo(b as &A); // Explicit cast should work as well
22 }
23
24 fn main() {}