2019-11-03 18:00:00 -06:00
|
|
|
// check-pass
|
2015-03-22 15:13:15 -05:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2014-12-07 09:22:06 -06:00
|
|
|
pub struct Foo;
|
|
|
|
|
|
|
|
pub trait Bar {
|
|
|
|
fn bar(&self);
|
|
|
|
}
|
|
|
|
|
2015-02-12 09:29:52 -06:00
|
|
|
pub trait Baz {
|
|
|
|
fn baz(&self) { }
|
|
|
|
}
|
2014-12-07 09:22:06 -06:00
|
|
|
|
|
|
|
impl<T: Baz> Bar for T {
|
|
|
|
fn bar(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Baz for Foo {}
|
|
|
|
|
|
|
|
pub fn foo(t: Box<Foo>) {
|
|
|
|
t.bar(); // ~Foo doesn't implement Baz
|
|
|
|
(*t).bar(); // ok b/c Foo implements Baz
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|