about summary refs log tree commit diff
path: root/src/libsyntax/ptr.rs
diff options
context:
space:
mode:
authorTaylor Cramer <cramertj@google.com>2018-06-06 15:50:59 -0700
committerTaylor Cramer <cramertj@google.com>2018-06-21 22:36:36 -0700
commitcf844b547dbec1f23982fca8e07ec65800ed5d6d (patch)
treea5420599dea5829f105d2a12bb14a3102141a749 /src/libsyntax/ptr.rs
parent589446e19cbf7a2c7eddf80b490992d31134015c (diff)
downloadrust-cf844b547dbec1f23982fca8e07ec65800ed5d6d.tar.gz
rust-cf844b547dbec1f23982fca8e07ec65800ed5d6d.zip
async await desugaring and tests
Diffstat (limited to 'src/libsyntax/ptr.rs')
-rw-r--r--src/libsyntax/ptr.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libsyntax/ptr.rs b/src/libsyntax/ptr.rs
index 25d916af77d..ed10857e4c5 100644
--- a/src/libsyntax/ptr.rs
+++ b/src/libsyntax/ptr.rs
@@ -95,6 +95,16 @@ impl<T: 'static> P<T> {
     }
 }
 
+impl<T: 'static> P<[T]> {
+    pub fn map_slice<F>(self, f: F) -> P<[T]> where
+        F: FnOnce(Vec<T>) -> Vec<T>
+    {
+        P {
+            ptr: f(self.ptr.into()).into(),
+        }
+    }
+}
+
 impl<T: ?Sized> Deref for P<T> {
     type Target = T;