Skip to content

Commit fd06ef2

Browse files
author
Jorge Aparicio
committed
librustc: fix fallout
1 parent 5e7469c commit fd06ef2

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#![feature(default_type_params, globs, import_shadowing, macro_rules, phase, quote)]
2626
#![feature(slicing_syntax, unsafe_destructor)]
2727
#![feature(rustc_diagnostic_macros)]
28+
#![feature(unboxed_closures)]
2829

2930
extern crate arena;
3031
extern crate flate;

src/librustc/middle/subst.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,15 +432,17 @@ impl<T> VecPerParamSpace<T> {
432432
self.all_vecs(|v| v.is_empty())
433433
}
434434

435-
pub fn map<U>(&self, pred: |&T| -> U) -> VecPerParamSpace<U> {
435+
pub fn map<U, P>(&self, pred: P) -> VecPerParamSpace<U> where P: FnMut(&T) -> U {
436436
let result = self.iter().map(pred).collect();
437437
VecPerParamSpace::new_internal(result,
438438
self.type_limit,
439439
self.self_limit,
440440
self.assoc_limit)
441441
}
442442

443-
pub fn map_enumerated<U>(&self, pred: |(ParamSpace, uint, &T)| -> U) -> VecPerParamSpace<U> {
443+
pub fn map_enumerated<U, P>(&self, pred: P) -> VecPerParamSpace<U> where
444+
P: FnMut((ParamSpace, uint, &T)) -> U,
445+
{
444446
let result = self.iter_enumerated().map(pred).collect();
445447
VecPerParamSpace::new_internal(result,
446448
self.type_limit,

src/librustc/middle/traits/mod.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ impl<'tcx, N> Vtable<'tcx, N> {
312312
}
313313
}
314314

315-
pub fn map_nested<M>(&self, op: |&N| -> M) -> Vtable<'tcx, M> {
315+
pub fn map_nested<M, F>(&self, op: F) -> Vtable<'tcx, M> where F: FnMut(&N) -> M {
316316
match *self {
317317
VtableImpl(ref i) => VtableImpl(i.map_nested(op)),
318318
VtableFnPointer(ref sig) => VtableFnPointer((*sig).clone()),
@@ -338,9 +338,8 @@ impl<'tcx, N> VtableImplData<'tcx, N> {
338338
self.nested.iter()
339339
}
340340

341-
pub fn map_nested<M>(&self,
342-
op: |&N| -> M)
343-
-> VtableImplData<'tcx, M>
341+
pub fn map_nested<M, F>(&self, op: F) -> VtableImplData<'tcx, M> where
342+
F: FnMut(&N) -> M,
344343
{
345344
VtableImplData {
346345
impl_def_id: self.impl_def_id,
@@ -365,10 +364,7 @@ impl<N> VtableBuiltinData<N> {
365364
self.nested.iter()
366365
}
367366

368-
pub fn map_nested<M>(&self,
369-
op: |&N| -> M)
370-
-> VtableBuiltinData<M>
371-
{
367+
pub fn map_nested<M, F>(&self, op: F) -> VtableBuiltinData<M> where F: FnMut(&N) -> M {
372368
VtableBuiltinData {
373369
nested: self.nested.map(op)
374370
}

src/librustc/util/ppaux.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,9 @@ pub fn trait_store_to_string(cx: &ctxt, s: ty::TraitStore) -> String {
241241
}
242242
}
243243

244-
pub fn vec_map_to_string<T>(ts: &[T], f: |t: &T| -> String) -> String {
244+
pub fn vec_map_to_string<T, F>(ts: &[T], f: F) -> String where
245+
F: FnMut(&T) -> String,
246+
{
245247
let tstrs = ts.iter().map(f).collect::<Vec<String>>();
246248
format!("[{}]", tstrs.connect(", "))
247249
}

0 commit comments

Comments
 (0)