diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2014-12-08 20:17:18 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2014-12-13 17:03:47 -0500 |
| commit | 933e7b4a3ec1ca93af8fa1cacba0f9bf55fe9daf (patch) | |
| tree | e3d4b04b83290997139b60f3ded1c7c15c0668f8 | |
| parent | 3739a2427bc66dc9a8ea4cb34bffee2fba6d107c (diff) | |
| download | rust-933e7b4a3ec1ca93af8fa1cacba0f9bf55fe9daf.tar.gz rust-933e7b4a3ec1ca93af8fa1cacba0f9bf55fe9daf.zip | |
librustc_llvm: use unboxed closures
| -rw-r--r-- | src/librustc_llvm/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index 23dad21e530..7d8338ba976 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<String> { +pub fn build_string<F>(f: F) -> Option<String> 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() |
