Skip to content

Commit

Permalink
auto merge of #8326 : thestinger/rust/iterator, r=alexcrichton
Browse files Browse the repository at this point in the history
The `extra::iter` module wasn't actually included in `extra.rs` when it was moved from `std`... I assume no one is going to miss it.
  • Loading branch information
bors committed Aug 7, 2013
2 parents 29ffbba + 55f3d04 commit cdba212
Show file tree
Hide file tree
Showing 22 changed files with 128 additions and 381 deletions.
4 changes: 2 additions & 2 deletions doc/tutorial-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ an intermediate generation has already exited:
~~~
# use std::task;
# fn sleep_forever() { loop { task::yield() } }
# fn wait_for_a_while() { do 1000.times { task::yield() } }
# fn wait_for_a_while() { for _ in range(0, 1000u) { task::yield() } }
# do task::try::<int> {
do task::spawn_supervised {
do task::spawn_supervised {
Expand All @@ -563,7 +563,7 @@ other at all, using `task::spawn_unlinked` for _isolated failure_.
~~~
# use std::task;
# fn random() -> uint { 100 }
# fn sleep_for(i: uint) { do i.times { task::yield() } }
# fn sleep_for(i: uint) { for _ in range(0, i) { task::yield() } }
# do task::try::<()> {
let (time1, time2) = (random(), random());
do task::spawn_unlinked {
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -1894,7 +1894,7 @@ struct TimeBomb {
impl Drop for TimeBomb {
fn drop(&self) {
do self.explosivity.times {
for _ in range(0, self.explosivity) {
println("blam!");
}
}
Expand Down
331 changes: 0 additions & 331 deletions src/libextra/iter.rs

This file was deleted.

2 changes: 1 addition & 1 deletion src/libextra/ringbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ mod tests {
let u: ~[int] = deq.iter().transform(|&x| x).collect();
assert_eq!(u, v);

let mut seq = iterator::Counter::new(0u, 2).take_(256);
let mut seq = iterator::count(0u, 2).take_(256);
let deq: RingBuf<uint> = seq.collect();
for (i, &x) in deq.iter().enumerate() {
assert_eq!(2*i, x);
Expand Down
5 changes: 5 additions & 0 deletions src/librustc/middle/trans/foreign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,11 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
let offset = get_param(decl, first_real_arg + 1);
Ret(bcx, GEP(bcx, ptr, [offset]));
}
"offset_inbounds" => {
let ptr = get_param(decl, first_real_arg);
let offset = get_param(decl, first_real_arg + 1);
Ret(bcx, InBoundsGEP(bcx, ptr, [offset]));
}
"memcpy32" => memcpy_intrinsic(bcx, "llvm.memcpy.p0i8.p0i8.i32", substs.tys[0], 32),
"memcpy64" => memcpy_intrinsic(bcx, "llvm.memcpy.p0i8.p0i8.i64", substs.tys[0], 64),
"memmove32" => memcpy_intrinsic(bcx, "llvm.memmove.p0i8.p0i8.i32", substs.tys[0], 32),
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/middle/trans/type_use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ pub fn type_uses_for(ccx: @mut CrateContext, fn_id: def_id, n_tps: uint)
"visit_tydesc" | "forget" | "frame_address" |
"morestack_addr" => 0,

"offset" | "memcpy32" | "memcpy64" | "memmove32" | "memmove64" |
"offset" | "offset_inbounds" |
"memcpy32" | "memcpy64" | "memmove32" | "memmove64" |
"memset32" | "memset64" => use_repr,

"sqrtf32" | "sqrtf64" | "powif32" | "powif64" |
Expand Down
Loading

0 comments on commit cdba212

Please sign in to comment.