about summary refs log tree commit diff
path: root/tests/ui/borrow-by-val-method-receiver.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/borrow-by-val-method-receiver.rs')
-rw-r--r--tests/ui/borrow-by-val-method-receiver.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/borrow-by-val-method-receiver.rs b/tests/ui/borrow-by-val-method-receiver.rs
new file mode 100644
index 00000000000..465bef1614d
--- /dev/null
+++ b/tests/ui/borrow-by-val-method-receiver.rs
@@ -0,0 +1,14 @@
+// run-pass
+
+trait Foo {
+    fn foo(self);
+}
+
+impl<'a> Foo for &'a [isize] {
+    fn foo(self) {}
+}
+
+pub fn main() {
+    let items = vec![ 3, 5, 1, 2, 4 ];
+    items.foo();
+}