]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-10456.rs
Rollup merge of #100168 - WaffleLapkin:improve_diagnostics_for_missing_type_in_a_cons...
[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() {}