diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2015-01-05 08:23:17 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2015-01-05 17:22:17 -0500 |
| commit | ef726591f81238f19bfd4cc3b48d812d20dbfcc2 (patch) | |
| tree | 3e1b9cdc570a898724defa9909875dd49ecc59b8 | |
| parent | 1bbeb375821fe197342f1e22ab53b796bb0f0c70 (diff) | |
| download | rust-ef726591f81238f19bfd4cc3b48d812d20dbfcc2.tar.gz rust-ef726591f81238f19bfd4cc3b48d812d20dbfcc2.zip | |
fix debuginfo tests
| -rw-r--r-- | src/test/debuginfo/closure-in-generic-function.rs | 2 | ||||
| -rw-r--r-- | src/test/debuginfo/lexical-scope-in-parameterless-closure.rs | 2 | ||||
| -rw-r--r-- | src/test/debuginfo/lexical-scope-in-stack-closure.rs | 4 | ||||
| -rw-r--r-- | src/test/debuginfo/multi-byte-chars.rs | 2 | ||||
| -rw-r--r-- | src/test/debuginfo/recursive-enum.rs | 4 | ||||
| -rw-r--r-- | src/test/debuginfo/type-names.rs | 12 | ||||
| -rw-r--r-- | src/test/debuginfo/var-captured-in-nested-closure.rs | 4 | ||||
| -rw-r--r-- | src/test/debuginfo/var-captured-in-stack-closure.rs | 8 |
8 files changed, 18 insertions, 20 deletions
diff --git a/src/test/debuginfo/closure-in-generic-function.rs b/src/test/debuginfo/closure-in-generic-function.rs index 84366ae7114..e3cb190c3f2 100644 --- a/src/test/debuginfo/closure-in-generic-function.rs +++ b/src/test/debuginfo/closure-in-generic-function.rs @@ -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) }; diff --git a/src/test/debuginfo/lexical-scope-in-parameterless-closure.rs b/src/test/debuginfo/lexical-scope-in-parameterless-closure.rs index b451f61d05e..b2617c57742 100644 --- a/src/test/debuginfo/lexical-scope-in-parameterless-closure.rs +++ b/src/test/debuginfo/lexical-scope-in-parameterless-closure.rs @@ -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); } diff --git a/src/test/debuginfo/lexical-scope-in-stack-closure.rs b/src/test/debuginfo/lexical-scope-in-stack-closure.rs index d6e3a43eea0..f2d09221669 100644 --- a/src/test/debuginfo/lexical-scope-in-stack-closure.rs +++ b/src/test/debuginfo/lexical-scope-in-stack-closure.rs @@ -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(); diff --git a/src/test/debuginfo/multi-byte-chars.rs b/src/test/debuginfo/multi-byte-chars.rs index dd0d86bf742..cb7e26327c3 100644 --- a/src/test/debuginfo/multi-byte-chars.rs +++ b/src/test/debuginfo/multi-byte-chars.rs @@ -24,5 +24,5 @@ struct C { θ: u8 } fn main() { let x = C { θ: 0 }; - (|c: C| c.θ )(x); + (|&: c: C| c.θ )(x); } diff --git a/src/test/debuginfo/recursive-enum.rs b/src/test/debuginfo/recursive-enum.rs index 93348e7b53e..73a68893e93 100644 --- a/src/test/debuginfo/recursive-enum.rs +++ b/src/test/debuginfo/recursive-enum.rs @@ -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 }; } diff --git a/src/test/debuginfo/type-names.rs b/src/test/debuginfo/type-names.rs index ddcbfdcceee..aac5824af00 100644 --- a/src/test/debuginfo/type-names.rs +++ b/src/test/debuginfo/type-names.rs @@ -167,11 +167,11 @@ // 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 } diff --git a/src/test/debuginfo/var-captured-in-nested-closure.rs b/src/test/debuginfo/var-captured-in-nested-closure.rs index 99d67c60516..3a7fbb9a3a1 100644 --- a/src/test/debuginfo/var-captured-in-nested-closure.rs +++ b/src/test/debuginfo/var-captured-in-nested-closure.rs @@ -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; }; diff --git a/src/test/debuginfo/var-captured-in-stack-closure.rs b/src/test/debuginfo/var-captured-in-stack-closure.rs index f474e8d1317..a743adae51e 100644 --- a/src/test/debuginfo/var-captured-in-stack-closure.rs +++ b/src/test/debuginfo/var-captured-in-stack-closure.rs @@ -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(); } } |
