diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-10456.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-10456.rs b/src/test/ui/issues/issue-10456.rs new file mode 100644 index 000000000..9f8d25955 --- /dev/null +++ b/src/test/ui/issues/issue-10456.rs @@ -0,0 +1,25 @@ +// check-pass +// pretty-expanded FIXME #23616 + +pub struct Foo; + +pub trait Bar { + fn bar(&self); +} + +pub trait Baz { + fn baz(&self) { } +} + +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() {} |