diff --git a/src/test/compile-fail/issue-1896-1.rs b/src/test/compile-fail/issue-1896-1.rs index 1b66e8ecdc96..29544caed533 100644 --- a/src/test/compile-fail/issue-1896-1.rs +++ b/src/test/compile-fail/issue-1896-1.rs @@ -11,7 +11,8 @@ struct boxedFn { theFn: &'self fn() -> uint } fn createClosure (closedUint: uint) -> boxedFn { - boxedFn {theFn: @fn () -> uint { closedUint }} //~ ERROR illegal borrow + let theFn: @fn() -> uint = || closedUint; + boxedFn {theFn: theFn} //~ ERROR illegal borrow } fn main () {