Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docify std::vec_ng #12955

Merged
merged 1 commit into from
Mar 19, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libnum/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl TotalOrd for BigUint {
if s_len < o_len { return Less; }
if s_len > o_len { return Greater; }

for (&self_i, &other_i) in self.data.rev_iter().zip(other.data.rev_iter()) {
for (&self_i, &other_i) in self.data.iter().rev().zip(other.data.iter().rev()) {
if self_i < other_i { return Less; }
if self_i > other_i { return Greater; }
}
Expand Down Expand Up @@ -788,7 +788,7 @@ impl BigUint {

let mut borrow = 0;
let mut shifted_rev = Vec::with_capacity(self.data.len());
for elem in self.data.rev_iter() {
for elem in self.data.iter().rev() {
shifted_rev.push((*elem >> n_bits) | borrow);
borrow = *elem << (BigDigit::bits - n_bits);
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/check_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ fn is_useful(cx: &MatchCheckCtxt, m: &matrix, v: &[@Pat]) -> useful {
is_useful_specialized(cx, m, v, vec(n), n, left_ty)
}
ty::ty_unboxed_vec(..) | ty::ty_vec(..) => {
let max_len = m.rev_iter().fold(0, |max_len, r| {
let max_len = m.iter().rev().fold(0, |max_len, r| {
match r.get(0).node {
PatVec(ref before, _, ref after) => {
cmp::max(before.len() + after.len(), max_len)
Expand Down
10 changes: 5 additions & 5 deletions src/librustc/middle/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ impl<'a> Liveness<'a> {
fn propagate_through_block(&mut self, blk: &Block, succ: LiveNode)
-> LiveNode {
let succ = self.propagate_through_opt_expr(blk.expr, succ);
blk.stmts.rev_iter().fold(succ, |succ, stmt| {
blk.stmts.iter().rev().fold(succ, |succ, stmt| {
self.propagate_through_stmt(*stmt, succ)
})
}
Expand Down Expand Up @@ -980,7 +980,7 @@ impl<'a> Liveness<'a> {
this.ir.tcx.sess.span_bug(expr.span, "no registered caps");
}
};
caps.deref().rev_iter().fold(succ, |succ, cap| {
caps.deref().iter().rev().fold(succ, |succ, cap| {
this.init_from_succ(cap.ln, succ);
let var = this.variable(cap.var_nid, expr.span);
this.acc(cap.ln, var, ACC_READ | ACC_USE);
Expand Down Expand Up @@ -1121,7 +1121,7 @@ impl<'a> Liveness<'a> {

ExprStruct(_, ref fields, with_expr) => {
let succ = self.propagate_through_opt_expr(with_expr, succ);
fields.rev_iter().fold(succ, |succ, field| {
fields.iter().rev().fold(succ, |succ, field| {
self.propagate_through_expr(field.expr, succ)
})
}
Expand Down Expand Up @@ -1173,14 +1173,14 @@ impl<'a> Liveness<'a> {
}

ExprInlineAsm(ref ia) => {
let succ = ia.outputs.rev_iter().fold(succ, |succ, &(_, expr)| {
let succ = ia.outputs.iter().rev().fold(succ, |succ, &(_, expr)| {
// see comment on lvalues in
// propagate_through_lvalue_components()
let succ = self.write_lvalue(expr, succ, ACC_WRITE);
self.propagate_through_lvalue_components(expr, succ)
});
// Inputs are executed first. Propagate last because of rev order
ia.inputs.rev_iter().fold(succ, |succ, &(_, expr)| {
ia.inputs.iter().rev().fold(succ, |succ, &(_, expr)| {
self.propagate_through_expr(expr, succ)
})
}
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/middle/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5520,7 +5520,8 @@ impl<'a> Resolver<'a> {
if idents.len() == 0 {
return ~"???";
}
return self.idents_to_str(idents.move_rev_iter()
return self.idents_to_str(idents.move_iter()
.rev()
.collect::<Vec<ast::Ident>>()
.as_slice());
}
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/middle/typeck/check/vtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ fn lookup_vtables(vcx: &VtableContext,
// We do this backwards for reasons discussed above.
assert_eq!(substs.tps.len(), type_param_defs.len());
let mut result: Vec<vtable_param_res> =
substs.tps.rev_iter()
substs.tps.iter()
.rev()
.zip(type_param_defs.rev_iter())
.map(|(ty, def)|
lookup_vtables_for_param(vcx, span, Some(substs),
Expand Down
Loading