remove the redundant each method from OptVec

This commit is contained in:
Daniel Micay 2013-06-24 17:19:28 -04:00
parent 032dcc57e8
commit 5242e8d2ba
11 changed files with 19 additions and 26 deletions

View file

@ -731,8 +731,8 @@ fn encode_info_for_method(ecx: &EncodeContext,
}
let mut combined_ty_params = opt_vec::Empty;
for owner_generics.ty_params.each |x| { combined_ty_params.push(copy *x) }
for method_generics.ty_params.each |x| { combined_ty_params.push(copy *x) }
for owner_generics.ty_params.iter().advance |x| { combined_ty_params.push(copy *x) }
for method_generics.ty_params.iter().advance |x| { combined_ty_params.push(copy *x) }
let len = combined_ty_params.len();
encode_type_param_bounds(ebml_w, ecx, &combined_ty_params);

View file

@ -3834,8 +3834,8 @@ impl Resolver {
pub fn resolve_type_parameters(@mut self,
type_parameters: &OptVec<TyParam>,
visitor: ResolveVisitor) {
for type_parameters.each |type_parameter| {
for type_parameter.bounds.each |bound| {
for type_parameters.iter().advance |type_parameter| {
for type_parameter.bounds.iter().advance |bound| {
self.resolve_type_parameter_bound(bound, visitor);
}
}
@ -4181,13 +4181,13 @@ impl Resolver {
}
}
for bounds.each |bound| {
for bounds.iter().advance |bound| {
self.resolve_type_parameter_bound(bound, visitor);
}
}
ty_closure(c) => {
for c.bounds.each |bound| {
for c.bounds.iter().advance |bound| {
self.resolve_type_parameter_bound(bound, visitor);
}
visit_ty(ty, ((), visitor));

View file

@ -752,7 +752,7 @@ fn conv_builtin_bounds(tcx: ty::ctxt,
//! legal.
let mut builtin_bounds = ty::EmptyBuiltinBounds();
for ast_bounds.each |ast_bound| {
for ast_bounds.iter().advance |ast_bound| {
match *ast_bound {
ast::TraitTyParamBound(b) => {
match lookup_def_tcx(tcx, b.path.span, b.ref_id) {

View file

@ -775,7 +775,7 @@ pub fn ensure_no_ty_param_bounds(ccx: &CrateCtxt,
span: span,
generics: &ast::Generics,
thing: &'static str) {
for generics.ty_params.each |ty_param| {
for generics.ty_params.iter().advance |ty_param| {
if ty_param.bounds.len() > 0 {
ccx.tcx.sess.span_err(
span,
@ -1172,7 +1172,7 @@ pub fn ty_generics(ccx: &CrateCtxt,
builtin_bounds: ty::EmptyBuiltinBounds(),
trait_bounds: ~[]
};
for ast_bounds.each |ast_bound| {
for ast_bounds.iter().advance |ast_bound| {
match *ast_bound {
TraitTyParamBound(b) => {
let ty = ty::mk_param(ccx.tcx, param_ty.idx, param_ty.def_id);

View file

@ -57,7 +57,7 @@ impl RegionParamNames {
}
fn has_ident(&self, ident: ast::ident) -> bool {
for self.each |region_param_name| {
for self.iter().advance |region_param_name| {
if *region_param_name == ident {
return true;
}