From ef726591f81238f19bfd4cc3b48d812d20dbfcc2 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Mon, 5 Jan 2015 08:23:17 -0500 Subject: [PATCH] fix debuginfo tests --- src/test/debuginfo/closure-in-generic-function.rs | 2 +- .../lexical-scope-in-parameterless-closure.rs | 2 +- src/test/debuginfo/lexical-scope-in-stack-closure.rs | 4 ++-- src/test/debuginfo/multi-byte-chars.rs | 2 +- src/test/debuginfo/recursive-enum.rs | 4 +--- src/test/debuginfo/type-names.rs | 12 ++++++------ src/test/debuginfo/var-captured-in-nested-closure.rs | 4 ++-- 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 84366ae71146..e3cb190c3f2c 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(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 b451f61d05e0..b2617c577425 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 d6e3a43eea0a..f2d092216697 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 dd0d86bf742e..cb7e26327c3d 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 93348e7b53e5..73a68893e933 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>, + pos_callback: Option>, } -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 ddcbfdcceee0..aac5824af005 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 99d67c60516b..3a7fbb9a3a13 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 f474e8d13179..a743adae51e9 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(); } }