]> git.lizzy.rs Git - rust.git/commitdiff
fix debuginfo tests
authorJorge Aparicio <japaricious@gmail.com>
Mon, 5 Jan 2015 13:23:17 +0000 (08:23 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Mon, 5 Jan 2015 22:22:17 +0000 (17:22 -0500)
src/test/debuginfo/closure-in-generic-function.rs
src/test/debuginfo/lexical-scope-in-parameterless-closure.rs
src/test/debuginfo/lexical-scope-in-stack-closure.rs
src/test/debuginfo/multi-byte-chars.rs
src/test/debuginfo/recursive-enum.rs
src/test/debuginfo/type-names.rs
src/test/debuginfo/var-captured-in-nested-closure.rs
src/test/debuginfo/var-captured-in-stack-closure.rs

index 84366ae71146501ee1e25e61d44c4d67fc009f78..e3cb190c3f2c46162ab1a7bb85a848f6c65ae9c7 100644 (file)
@@ -50,7 +50,7 @@
 
 fn some_generic_fun<T1, T2>(a: T1, b: T2) -> (T2, T1) {
 
-    let closure = |x, y| {
+    let closure = |&: x, y| {
         zzz(); // #break
         (y, x)
     };
index b451f61d05e0efd9edaec24a4810d140b5905648..b2617c57742522c6788e0e32c0e80df6b86f62cc 100644 (file)
@@ -18,7 +18,7 @@
 
 // Nothing to do here really, just make sure it compiles. See issue #8513.
 fn main() {
-    let _ = ||();
+    let _ = |&:|();
     let _ = range(1u,3).map(|_| 5i);
 }
 
index d6e3a43eea0a6383f478ebf0a23243515bfcff8c..f2d092216697ff25c543c4f380daff04703f4a23 100644 (file)
@@ -79,7 +79,7 @@ fn main() {
     zzz(); // #break
     sentinel();
 
-    let stack_closure: |int| = |x| {
+    let closure = |&: x: int| {
         zzz(); // #break
         sentinel();
 
@@ -97,7 +97,7 @@ fn main() {
     zzz(); // #break
     sentinel();
 
-    stack_closure(1000);
+    closure(1000);
 
     zzz(); // #break
     sentinel();
index dd0d86bf742e6415adadd180bc6e836bfee08d05..cb7e26327c3def2f52406095226ad97a03475a21 100644 (file)
@@ -24,5 +24,5 @@ struct C { θ: u8 }
 
 fn main() {
     let x =  C { θ: 0 };
-    (|c: C| c.θ )(x);
+    (|&: c: C| c.θ )(x);
 }
index 93348e7b53e559b9732726850bae5c61fb1898ed..73a68893e933cac81089fa72a0b11d63a88cd2bd 100644 (file)
@@ -25,11 +25,9 @@ pub struct Window<'a> {
 }
 
 struct WindowCallbacks<'a> {
-    pos_callback: Option<WindowPosCallback<'a>>,
+    pos_callback: Option<Box<FnMut(&Window, i32, i32) + 'a>>,
 }
 
-pub type WindowPosCallback<'a> = |&Window, i32, i32|: 'a;
-
 fn main() {
     let x = WindowCallbacks { pos_callback: None };
 }
index ddcbfdcceee01c2c8bbb36d54055a53990cd3d62..aac5824af00507e6731cc860e5b2762f7e47c7f8 100644 (file)
 
 
 // CLOSURES
-// gdb-command:whatis stack_closure1
-// gdb-check:type = struct (&mut|int|, uint)
+// gdb-command:whatis closure1
+// gdb-check:type = struct (closure, uint)
 
-// gdb-command:whatis stack_closure2
-// gdb-check:type = struct (&mut|i8, f32| -> f32, uint)
+// gdb-command:whatis closure2
+// gdb-check:type = struct (closure, uint)
 
 #![omit_gdb_pretty_printer_section]
 
@@ -321,8 +321,8 @@ fn main() {
     // how that maps to rustc's internal representation of these forms.
     // Once closures have reached their 1.0 form, the tests below should
     // probably be expanded.
-    let stack_closure1 = (|x:int| {}, 0u);
-    let stack_closure2 = (|x:i8, y: f32| { (x as f32) + y }, 0u);
+    let closure1 = (|&: x:int| {}, 0u);
+    let closure2 = (|&: x:i8, y: f32| { (x as f32) + y }, 0u);
 
     zzz(); // #break
 }
index 99d67c60516b5a6fe1e8652c6efcf6e6952b7c4a..3a7fbb9a3a1324ad02b515c53c257f2c401e4f9e 100644 (file)
@@ -100,10 +100,10 @@ fn main() {
     let struct_ref = &a_struct;
     let owned = box 6;
 
-    let closure = || {
+    let mut closure = |&mut:| {
         let closure_local = 8;
 
-        let nested_closure = || {
+        let mut nested_closure = |&mut:| {
             zzz(); // #break
             variable = constant + a_struct.a + struct_ref.a + *owned + closure_local;
         };
index f474e8d1317993feb8647e2d2626a4fb32ab9b9f..a743adae51e9c54e01989351a4fa4ead3e7d09ad 100644 (file)
@@ -94,20 +94,20 @@ fn main() {
     let owned = box 6;
 
     {
-        let closure = || {
+        let mut first_closure = |&mut:| {
             zzz(); // #break
             variable = constant + a_struct.a + struct_ref.a + *owned;
         };
 
-        closure();
+        first_closure();
     }
 
     {
-        let mut unboxed_closure = |&mut:| {
+        let mut second_closure = |&mut:| {
             zzz(); // #break
             variable = constant + a_struct.a + struct_ref.a + *owned;
         };
-        unboxed_closure();
+        second_closure();
     }
 }