about summary refs log tree commit diff
path: root/tests/ui/traits/inherent-method-order.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/inherent-method-order.rs')
-rw-r--r--tests/ui/traits/inherent-method-order.rs25
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 00000000000..f632ae8a9ac
--- /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();
+}