Skip to content

iterator-related cleanup #8326

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

Merged
merged 7 commits into from
Aug 7, 2013
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 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