librustc_llvm: use unboxed closures
This commit is contained in:
parent
3739a2427b
commit
933e7b4a3e
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user