2019-11-04 00:00:00 +00:00
|
|
|
// check-pass
|
2015-03-22 13:13:15 -07:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2014-12-07 15:22:06 +00:00
|
|
|
pub struct Foo;
|
|
|
|
|
|
|
|
pub trait Bar {
|
|
|
|
fn bar(&self);
|
|
|
|
}
|
|
|
|
|
2015-02-12 10:29:52 -05:00
|
|
|
pub trait Baz {
|
|
|
|
fn baz(&self) { }
|
|
|
|
}
|
2014-12-07 15:22:06 +00: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() {}
|