]> git.lizzy.rs Git - rust.git/blob - src/test/ui/autoref-autoderef/auto-ref-bounded-ty-param.rs
Rollup merge of #62994 - iluuu1994:test-for-43398, r=nikomatsakis
[rust.git] / src / test / ui / autoref-autoderef / auto-ref-bounded-ty-param.rs
1 // run-pass
2 trait Foo {
3     fn f(&self);
4 }
5
6 struct Bar {
7     x: isize
8 }
9
10 trait Baz {
11     fn g(&self);
12 }
13
14 impl<T:Baz> Foo for T {
15     fn f(&self) {
16         self.g();
17     }
18 }
19
20 impl Baz for Bar {
21     fn g(&self) {
22         println!("{}", self.x);
23     }
24 }
25
26 pub fn main() {
27     let y = Bar { x: 42 };
28     y.f();
29 }