Skip to content

Commit ef72659

Browse files
author
Jorge Aparicio
committed
fix debuginfo tests
1 parent 1bbeb37 commit ef72659

8 files changed

+18
-20
lines changed

src/test/debuginfo/closure-in-generic-function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
fn some_generic_fun<T1, T2>(a: T1, b: T2) -> (T2, T1) {
5252

53-
let closure = |x, y| {
53+
let closure = |&: x, y| {
5454
zzz(); // #break
5555
(y, x)
5656
};

src/test/debuginfo/lexical-scope-in-parameterless-closure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
// Nothing to do here really, just make sure it compiles. See issue #8513.
2020
fn main() {
21-
let _ = ||();
21+
let _ = |&:|();
2222
let _ = range(1u,3).map(|_| 5i);
2323
}
2424

src/test/debuginfo/lexical-scope-in-stack-closure.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn main() {
7979
zzz(); // #break
8080
sentinel();
8181

82-
let stack_closure: |int| = |x| {
82+
let closure = |&: x: int| {
8383
zzz(); // #break
8484
sentinel();
8585

@@ -97,7 +97,7 @@ fn main() {
9797
zzz(); // #break
9898
sentinel();
9999

100-
stack_closure(1000);
100+
closure(1000);
101101

102102
zzz(); // #break
103103
sentinel();

src/test/debuginfo/multi-byte-chars.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ struct C { θ: u8 }
2424

2525
fn main() {
2626
let x = C { θ: 0 };
27-
(|c: C| c.θ )(x);
27+
(|&: c: C| c.θ )(x);
2828
}

src/test/debuginfo/recursive-enum.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ pub struct Window<'a> {
2525
}
2626

2727
struct WindowCallbacks<'a> {
28-
pos_callback: Option<WindowPosCallback<'a>>,
28+
pos_callback: Option<Box<FnMut(&Window, i32, i32) + 'a>>,
2929
}
3030

31-
pub type WindowPosCallback<'a> = |&Window, i32, i32|: 'a;
32-
3331
fn main() {
3432
let x = WindowCallbacks { pos_callback: None };
3533
}

src/test/debuginfo/type-names.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@
167167

168168

169169
// CLOSURES
170-
// gdb-command:whatis stack_closure1
171-
// gdb-check:type = struct (&mut|int|, uint)
170+
// gdb-command:whatis closure1
171+
// gdb-check:type = struct (closure, uint)
172172

173-
// gdb-command:whatis stack_closure2
174-
// gdb-check:type = struct (&mut|i8, f32| -> f32, uint)
173+
// gdb-command:whatis closure2
174+
// gdb-check:type = struct (closure, uint)
175175

176176
#![omit_gdb_pretty_printer_section]
177177

@@ -321,8 +321,8 @@ fn main() {
321321
// how that maps to rustc's internal representation of these forms.
322322
// Once closures have reached their 1.0 form, the tests below should
323323
// probably be expanded.
324-
let stack_closure1 = (|x:int| {}, 0u);
325-
let stack_closure2 = (|x:i8, y: f32| { (x as f32) + y }, 0u);
324+
let closure1 = (|&: x:int| {}, 0u);
325+
let closure2 = (|&: x:i8, y: f32| { (x as f32) + y }, 0u);
326326

327327
zzz(); // #break
328328
}

src/test/debuginfo/var-captured-in-nested-closure.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ fn main() {
100100
let struct_ref = &a_struct;
101101
let owned = box 6;
102102

103-
let closure = || {
103+
let mut closure = |&mut:| {
104104
let closure_local = 8;
105105

106-
let nested_closure = || {
106+
let mut nested_closure = |&mut:| {
107107
zzz(); // #break
108108
variable = constant + a_struct.a + struct_ref.a + *owned + closure_local;
109109
};

src/test/debuginfo/var-captured-in-stack-closure.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,20 @@ fn main() {
9494
let owned = box 6;
9595

9696
{
97-
let closure = || {
97+
let mut first_closure = |&mut:| {
9898
zzz(); // #break
9999
variable = constant + a_struct.a + struct_ref.a + *owned;
100100
};
101101

102-
closure();
102+
first_closure();
103103
}
104104

105105
{
106-
let mut unboxed_closure = |&mut:| {
106+
let mut second_closure = |&mut:| {
107107
zzz(); // #break
108108
variable = constant + a_struct.a + struct_ref.a + *owned;
109109
};
110-
unboxed_closure();
110+
second_closure();
111111
}
112112
}
113113

0 commit comments

Comments
 (0)