summary refs log tree commit diff
path: root/src/libsyntax/util
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2014-12-08 13:28:32 -0500
committerJorge Aparicio <japaricious@gmail.com>2014-12-13 17:03:47 -0500
commit0dac05dd627612232403c07ca8bd6d3376eec64a (patch)
tree656a23a7314866c8fa5cc6ca787111db41d90834 /src/libsyntax/util
parent2160427900ea675e494274d42a8d8485724f440e (diff)
downloadrust-0dac05dd627612232403c07ca8bd6d3376eec64a.tar.gz
rust-0dac05dd627612232403c07ca8bd6d3376eec64a.zip
libsyntax: use unboxed closures
Diffstat (limited to 'src/libsyntax/util')
-rw-r--r--src/libsyntax/util/parser_testing.rs4
-rw-r--r--src/libsyntax/util/small_vector.rs2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs
index c1ea8f60b82..83bbff8473d 100644
--- a/src/libsyntax/util/parser_testing.rs
+++ b/src/libsyntax/util/parser_testing.rs
@@ -31,7 +31,9 @@ pub fn string_to_parser<'a>(ps: &'a ParseSess, source_str: String) -> Parser<'a>
                                source_str)
 }
 
-fn with_error_checking_parse<T>(s: String, f: |&mut Parser| -> T) -> T {
+fn with_error_checking_parse<T, F>(s: String, f: F) -> T where
+    F: FnOnce(&mut Parser) -> T,
+{
     let ps = new_parse_sess();
     let mut p = string_to_parser(&ps, s);
     let x = f(&mut p);
diff --git a/src/libsyntax/util/small_vector.rs b/src/libsyntax/util/small_vector.rs
index d56e4f70449..8d050e34abf 100644
--- a/src/libsyntax/util/small_vector.rs
+++ b/src/libsyntax/util/small_vector.rs
@@ -171,7 +171,7 @@ impl<T> Iterator<T> for MoveItems<T> {
 }
 
 impl<T> MoveMap<T> for SmallVector<T> {
-    fn move_map(self, f: |T| -> T) -> SmallVector<T> {
+    fn move_map<F>(self, mut f: F) -> SmallVector<T> where F: FnMut(T) -> T {
         let repr = match self.repr {
             Zero => Zero,
             One(v) => One(f(v)),