Skip to content

Commit 078fd23

Browse files
committed
fix test to not use fn expr
1 parent 9792002 commit 078fd23

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/compile-fail/issue-1896-1.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
struct boxedFn { theFn: &'self fn() -> uint }
1212

1313
fn createClosure (closedUint: uint) -> boxedFn {
14-
boxedFn {theFn: @fn () -> uint { closedUint }} //~ ERROR illegal borrow
14+
let theFn: @fn() -> uint = || closedUint;
15+
boxedFn {theFn: theFn} //~ ERROR illegal borrow
1516
}
1617

1718
fn main () {

0 commit comments

Comments
 (0)