mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
librustc: fix fallout
This commit is contained in:
parent
5e7469cfe1
commit
fd06ef24bb
@ -25,6 +25,7 @@
|
||||
#![feature(default_type_params, globs, import_shadowing, macro_rules, phase, quote)]
|
||||
#![feature(slicing_syntax, unsafe_destructor)]
|
||||
#![feature(rustc_diagnostic_macros)]
|
||||
#![feature(unboxed_closures)]
|
||||
|
||||
extern crate arena;
|
||||
extern crate flate;
|
||||
|
@ -432,7 +432,7 @@ impl<T> VecPerParamSpace<T> {
|
||||
self.all_vecs(|v| v.is_empty())
|
||||
}
|
||||
|
||||
pub fn map<U>(&self, pred: |&T| -> U) -> VecPerParamSpace<U> {
|
||||
pub fn map<U, P>(&self, pred: P) -> VecPerParamSpace<U> where P: FnMut(&T) -> U {
|
||||
let result = self.iter().map(pred).collect();
|
||||
VecPerParamSpace::new_internal(result,
|
||||
self.type_limit,
|
||||
@ -440,7 +440,9 @@ impl<T> VecPerParamSpace<T> {
|
||||
self.assoc_limit)
|
||||
}
|
||||
|
||||
pub fn map_enumerated<U>(&self, pred: |(ParamSpace, uint, &T)| -> U) -> VecPerParamSpace<U> {
|
||||
pub fn map_enumerated<U, P>(&self, pred: P) -> VecPerParamSpace<U> where
|
||||
P: FnMut((ParamSpace, uint, &T)) -> U,
|
||||
{
|
||||
let result = self.iter_enumerated().map(pred).collect();
|
||||
VecPerParamSpace::new_internal(result,
|
||||
self.type_limit,
|
||||
|
@ -312,7 +312,7 @@ impl<'tcx, N> Vtable<'tcx, N> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn map_nested<M>(&self, op: |&N| -> M) -> Vtable<'tcx, M> {
|
||||
pub fn map_nested<M, F>(&self, op: F) -> Vtable<'tcx, M> where F: FnMut(&N) -> M {
|
||||
match *self {
|
||||
VtableImpl(ref i) => VtableImpl(i.map_nested(op)),
|
||||
VtableFnPointer(ref sig) => VtableFnPointer((*sig).clone()),
|
||||
@ -338,9 +338,8 @@ impl<'tcx, N> VtableImplData<'tcx, N> {
|
||||
self.nested.iter()
|
||||
}
|
||||
|
||||
pub fn map_nested<M>(&self,
|
||||
op: |&N| -> M)
|
||||
-> VtableImplData<'tcx, M>
|
||||
pub fn map_nested<M, F>(&self, op: F) -> VtableImplData<'tcx, M> where
|
||||
F: FnMut(&N) -> M,
|
||||
{
|
||||
VtableImplData {
|
||||
impl_def_id: self.impl_def_id,
|
||||
@ -365,10 +364,7 @@ impl<N> VtableBuiltinData<N> {
|
||||
self.nested.iter()
|
||||
}
|
||||
|
||||
pub fn map_nested<M>(&self,
|
||||
op: |&N| -> M)
|
||||
-> VtableBuiltinData<M>
|
||||
{
|
||||
pub fn map_nested<M, F>(&self, op: F) -> VtableBuiltinData<M> where F: FnMut(&N) -> M {
|
||||
VtableBuiltinData {
|
||||
nested: self.nested.map(op)
|
||||
}
|
||||
|
@ -241,7 +241,9 @@ pub fn trait_store_to_string(cx: &ctxt, s: ty::TraitStore) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn vec_map_to_string<T>(ts: &[T], f: |t: &T| -> String) -> String {
|
||||
pub fn vec_map_to_string<T, F>(ts: &[T], f: F) -> String where
|
||||
F: FnMut(&T) -> String,
|
||||
{
|
||||
let tstrs = ts.iter().map(f).collect::<Vec<String>>();
|
||||
format!("[{}]", tstrs.connect(", "))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user