]> git.lizzy.rs Git - rust.git/blob - src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.rs
Rollup merge of #99516 - m-ou-se:proc-macro-tracked-tracking-issue, r=Mark-Simulacrum
[rust.git] / src / test / ui / missing-trait-bounds / missing-trait-bounds-for-method-call.rs
1 #[derive(Default, PartialEq)]
2 struct Foo<T> {
3     bar: Box<[T]>,
4 }
5
6 trait Bar {
7     fn foo(&self) {}
8 }
9
10 impl<T: Default + Bar> Bar for Foo<T> {}
11
12 impl<T> Foo<T> {
13     fn bar(&self) {
14         self.foo();
15         //~^ ERROR the method
16     }
17 }
18
19 struct Fin<T> where T: Bar {
20     bar: Box<[T]>,
21 }
22
23 impl<T: Default + Bar> Bar for Fin<T> {}
24
25 impl<T: Bar> Fin<T> {
26     fn bar(&self) {
27         self.foo();
28         //~^ ERROR the method
29     }
30 }
31 fn main() {}