]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/inherent-method-order.rs
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / ui / traits / inherent-method-order.rs
1 // run-pass
2
3 struct Foo;
4
5 impl Foo {
6     #[allow(dead_code)]
7     fn foo(self) {
8         panic!("wrong method!")
9     }
10 }
11
12 trait Trait {
13     fn foo(self);
14 }
15
16 impl<'a,'b,'c> Trait for &'a &'b &'c Foo {
17     fn foo(self) {
18         // ok
19     }
20 }
21
22 fn main() {
23     let x = &(&(&Foo));
24     x.foo();
25 }