Skip to content

Commit 933e7b4

Browse files
author
Jorge Aparicio
committed
librustc_llvm: use unboxed closures
1 parent 3739a24 commit 933e7b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_llvm/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#![feature(globs)]
2525
#![feature(link_args)]
26+
#![feature(unboxed_closures)]
2627

2728
extern crate libc;
2829

@@ -2206,7 +2207,7 @@ pub unsafe extern "C" fn rust_llvm_string_write_impl(sr: RustStringRef,
22062207
(*sr).borrow_mut().push_all(slice);
22072208
}
22082209

2209-
pub fn build_string(f: |RustStringRef|) -> Option<String> {
2210+
pub fn build_string<F>(f: F) -> Option<String> where F: FnOnce(RustStringRef){
22102211
let mut buf = RefCell::new(Vec::new());
22112212
f(&mut buf as RustStringRepr as RustStringRef);
22122213
String::from_utf8(buf.into_inner()).ok()

0 commit comments

Comments
 (0)