diff options
Diffstat (limited to 'tests/ui/traits/inherent-method-order.rs')
-rw-r--r-- | tests/ui/traits/inherent-method-order.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/traits/inherent-method-order.rs b/tests/ui/traits/inherent-method-order.rs new file mode 100644 index 000000000..f632ae8a9 --- /dev/null +++ b/tests/ui/traits/inherent-method-order.rs @@ -0,0 +1,25 @@ +// run-pass + +struct Foo; + +impl Foo { + #[allow(dead_code)] + fn foo(self) { + panic!("wrong method!") + } +} + +trait Trait { + fn foo(self); +} + +impl<'a,'b,'c> Trait for &'a &'b &'c Foo { + fn foo(self) { + // ok + } +} + +fn main() { + let x = &(&(&Foo)); + x.foo(); +} |