rust/tests/ui/issues/issue-10456.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
343 B
Rust
Raw Normal View History

// check-pass
// pretty-expanded FIXME #23616
2014-12-07 15:22:06 +00:00
pub struct Foo;
pub trait Bar {
fn bar(&self);
}
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() {}