]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-10456.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[rust.git] / src / test / ui / issues / issue-10456.rs
1 // check-pass
2 // pretty-expanded FIXME #23616
3
4 pub struct Foo;
5
6 pub trait Bar {
7     fn bar(&self);
8 }
9
10 pub trait Baz {
11     fn baz(&self) { }
12 }
13
14 impl<T: Baz> Bar for T {
15     fn bar(&self) {}
16 }
17
18 impl Baz for Foo {}
19
20 pub fn foo(t: Box<Foo>) {
21     t.bar(); // ~Foo doesn't implement Baz
22     (*t).bar(); // ok b/c Foo implements Baz
23 }
24
25 fn main() {}