rust/src/libcore
bors fb62f4d544 Auto merge of #36490 - bluss:zip-slightly-despecialized-edition, r=alexcrichton
Remove data structure specialization for .zip() iterator

Go back on half the specialization, the part that changed the Zip
struct's fields themselves depending on the types of the iterators.

Previous PR: #33090

This means that the Zip iterator will always carry two usize fields,
which are sometimes unused. If a whole for loop using a .zip() iterator is
inlined, these are simply removed and have no effect.

The same improvement for Zip of for example slice iterators remain, and
they still optimize well. However, like when the specialization of zip
was merged, the compiler is still very sensistive to the exact context.

For example this code only autovectorizes if the function is used, not
if the code in zip_sum_i32 is inserted inline where it was called:

```rust
fn zip_sum_i32(xs: &[i32], ys: &[i32]) -> i32 {
    let mut s = 0;
    for (&x, &y) in xs.iter().zip(ys) {
        s += x * y;
    }
    s
}

fn zipdot_i32_default_zip(b: &mut test::Bencher)
{
    let xs = vec![1; 1024];
    let ys = vec![1; 1024];

    b.iter(|| {
        zip_sum_i32(&xs, &ys)
    })
}
```

Include a test that checks that `Zip<T, U>` is covariant w.r.t. T and U.

Fixes #35727
2016-09-17 08:23:44 -07:00
..
fmt Use #[prelude_import] in libcore. 2016-08-24 22:12:23 +00:00
hash Documentation of what does for each type 2016-09-11 17:00:09 +05:30
iter Auto merge of #36490 - bluss:zip-slightly-despecialized-edition, r=alexcrichton 2016-09-17 08:23:44 -07:00
num Use question_mark feature in libcore. 2016-09-11 16:00:50 -07:00
prelude Add missing annotations and some tests 2015-11-18 01:24:21 +03:00
str Documentation of what does for each type 2016-09-11 17:00:09 +05:30
sync Documentation for default types modified 2016-09-11 22:58:01 +05:30
any.rs Replace unnecessary uses of TraitObject with casts 2016-08-26 06:37:36 -04:00
array.rs Use #[prelude_import] in libcore. 2016-08-24 22:12:23 +00:00
borrow.rs Use #[prelude_import] in libcore. 2016-08-24 22:12:23 +00:00
Cargo.toml No build.rs for libcore 2016-06-04 15:10:26 -07:00
cell.rs Documentation of what does for each type 2016-09-11 17:00:09 +05:30
char.rs Implement TryFrom<u32> for char 2016-08-29 17:34:02 +02:00
char_private.rs Use #[prelude_import] in libcore. 2016-08-24 22:12:23 +00:00
clone.rs Rollup merge of #36384 - petrochenkov:derclone, r=alexcrichton 2016-09-15 18:16:19 +05:30
cmp.rs Improve Eq deriving 2016-09-10 22:37:06 +03:00
convert.rs Add example in AsMut trait documentation 2016-09-15 19:47:04 -06:00
default.rs Use #[prelude_import] in libcore. 2016-08-24 22:12:23 +00:00
intrinsics.rs Auto merge of #36181 - seanmonstar:likely, r=nikomatsakis 2016-09-13 10:54:55 -07:00
iter_private.rs Use #[prelude_import] in libcore. 2016-08-24 22:12:23 +00:00
lib.rs Use #[prelude_import] in libcore. 2016-08-24 22:12:23 +00:00
macros.rs Document try!'s error conversion behaviour 2016-09-01 19:16:19 +02:00
marker.rs Tweak std::marker docs 2016-09-15 12:31:17 -07:00
mem.rs Tweak std::mem docs 2016-09-10 10:48:01 -07:00
nonzero.rs Use #[prelude_import] in libcore. 2016-08-24 22:12:23 +00:00
ops.rs Rollup merge of #35793 - matthew-piziak:add-rhs-example, r=steveklabnik 2016-09-02 15:28:50 -07:00
option.rs Rollup merge of #36396 - athulappadan:Default-docs, r=bluss 2016-09-14 17:15:37 +02:00
panicking.rs Mark all extern functions as nounwind 2015-09-14 11:36:09 +02:00
ptr.rs Add std::ptr::eq, for referential equality of &T references. 2016-09-15 18:48:16 +02:00
raw.rs Clean up std::raw docs 2016-08-05 17:52:37 -04:00
result.rs Improve Result doc 2016-09-11 11:58:20 +02:00
slice.rs Rollup merge of #36454 - bluss:slice-primitive-index, r=alexcrichton 2016-09-15 18:16:21 +05:30
tuple.rs Use #[prelude_import] in libcore. 2016-08-24 22:12:23 +00:00