summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/inherent-method-order.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/traits/inherent-method-order.rs')
-rw-r--r--src/test/ui/traits/inherent-method-order.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/traits/inherent-method-order.rs b/src/test/ui/traits/inherent-method-order.rs
new file mode 100644
index 000000000..f632ae8a9
--- /dev/null
+++ b/src/test/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();
+}