]> git.lizzy.rs Git - rust.git/commitdiff
fix pretty tests
authorJorge Aparicio <japaricious@gmail.com>
Mon, 5 Jan 2015 13:22:04 +0000 (08:22 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Mon, 5 Jan 2015 22:22:17 +0000 (17:22 -0500)
src/test/pretty/closure-reform-pretty.rs
src/test/pretty/disamb-stmt-expr.rs
src/test/pretty/do1.rs
src/test/pretty/fn-types.rs

index 328d4245eb61011acc5edbff4e2998a7356c513d..094e3ce91568623094d272c85a5c10366498be88 100644 (file)
@@ -15,9 +15,9 @@
 
 fn call_it(f: Box<FnMut(String) -> String>) { }
 
-fn call_this(f: |&str|: Send) { }
+fn call_this<F>(f: F) where F: Fn(&str) + Send { }
 
-fn call_that(f: <'a>|&'a int, &'a int| -> int) { }
+fn call_that<F>(f: F) where F: for<'a>Fn(&'a int, &'a int) -> int { }
 
 fn call_extern(f: fn() -> int) { }
 
index 78658a4c12169db5709fcdefc9dd14c3c5ed4f97..0c4cd103b82ef73547ebf7c1e32da23d101d18ef 100644 (file)
@@ -14,7 +14,7 @@
 // preserved.  They are needed to disambiguate `{return n+1}; - 0` from
 // `({return n+1}-0)`.
 
-fn id(f: || -> int) -> int { f() }
+fn id<F>(f: F) -> int where F: Fn() -> int { f() }
 
 fn wsucc(_n: int) -> int { id(|| { 1 }) - 0 }
 fn main() { }
index cd7a5b29a8af1eef189c8604220e33efad5a995e..e0066053f3c5baf5b9d2f0ad2c347055a7b5db10 100644 (file)
@@ -10,6 +10,6 @@
 
 // pp-exact
 
-fn f(f: |int|) { f(10) }
+fn f<F>(f: F) where F: Fn(int) { f(10) }
 
 fn main() { f(|i| { assert!(i == 10) }) }
index 1313af2df3d88c742a5b11f7b9658ca6519157e4..31efb0c9ab1ebd84f9a87f6126194232faaf846f 100644 (file)
@@ -11,5 +11,5 @@
 // pp-exact
 
 fn from_foreign_fn(_x: fn()) { }
-fn from_stack_closure(_x: ||) { }
+fn from_stack_closure<F>(_x: F) where F: Fn() { }
 fn main() { }