diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 573c63eb6af0..a7163b75d524 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -1938,11 +1938,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { infer::mk_subr(self.infcx(), origin, sub, sup) } - pub fn type_error_message(&self, - sp: Span, - mk_msg: |String| -> String, - actual_ty: Ty<'tcx>, - err: Option<&ty::type_err<'tcx>>) { + pub fn type_error_message(&self, + sp: Span, + mk_msg: M, + actual_ty: Ty<'tcx>, + err: Option<&ty::type_err<'tcx>>) where + M: FnOnce(String) -> String, + { self.infcx().type_error_message(sp, mk_msg, actual_ty, err); } diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 41ed5b8ec365..0cf43821c82d 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -74,6 +74,7 @@ This API is completely unstable and subject to change. #![feature(default_type_params, globs, import_shadowing, macro_rules, phase, quote)] #![feature(slicing_syntax, unsafe_destructor)] #![feature(rustc_diagnostic_macros)] +#![feature(unboxed_closures)] #![allow(non_camel_case_types)] #[phase(plugin, link)] extern crate log;