diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index 23dad21e5303..7d8338ba976d 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -23,6 +23,7 @@ #![feature(globs)] #![feature(link_args)] +#![feature(unboxed_closures)] extern crate libc; @@ -2206,7 +2207,7 @@ pub unsafe extern "C" fn rust_llvm_string_write_impl(sr: RustStringRef, (*sr).borrow_mut().push_all(slice); } -pub fn build_string(f: |RustStringRef|) -> Option { +pub fn build_string(f: F) -> Option where F: FnOnce(RustStringRef){ let mut buf = RefCell::new(Vec::new()); f(&mut buf as RustStringRepr as RustStringRef); String::from_utf8(buf.into_inner()).ok()