2019-11-03 18:00:00 -06:00
|
|
|
// check-pass
|
2018-09-25 16:51:35 -05:00
|
|
|
#![allow(dead_code)]
|
2014-06-05 17:06:33 -05:00
|
|
|
// #11612
|
|
|
|
// We weren't updating the auto adjustments with all the resolved
|
|
|
|
// type information after type check.
|
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2015-02-12 09:29:52 -06:00
|
|
|
trait A { fn dummy(&self) { } }
|
2014-06-05 17:06:33 -05:00
|
|
|
|
2014-08-27 20:46:52 -05:00
|
|
|
struct B<'a, T:'a> {
|
2014-06-05 17:06:33 -05:00
|
|
|
f: &'a T
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a, T> A for B<'a, T> {}
|
|
|
|
|
2019-05-28 13:46:13 -05:00
|
|
|
fn foo(_: &dyn A) {}
|
2014-06-05 17:06:33 -05:00
|
|
|
|
|
|
|
fn bar<G>(b: &B<G>) {
|
|
|
|
foo(b); // Coercion should work
|
2019-05-28 13:46:13 -05:00
|
|
|
foo(b as &dyn A); // Explicit cast should work as well
|
2014-06-05 17:06:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|