Skip to content

liballoc: slice benchmarks fail to build #54013

Closed
@matthiaskrgr

Description

@matthiaskrgr

repo @ c318691
./x.py bench

Benchmarking alloc stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling alloc v0.0.0 (file:///home/matthias/vcs/github/rust/src/liballoc)
error[E0308]: mismatched types
   --> liballoc/../liballoc/benches/slice.rs:196:42
    |
196 |     let mut rng = XorShiftRng::from_seed([0, 1, 2, 3]);
    |                                          ^^^^^^^^^^^^ expected an array with a fixed size of 16 elements, found one with 4 elements
    |
    = note: expected type `[u8; 16]`
               found type `[u8; 4]`
error: use of deprecated item 'rand::Rng::gen_iter': use Rng::sample_iter(&Standard) instead
   --> liballoc/../liballoc/benches/slice.rs:197:9
    |
197 |     rng.gen_iter::<u64>().take(len).collect()
    |         ^^^^^^^^
    |
    = note: `-D deprecated` implied by `-D warnings`
error[E0308]: mismatched types
   --> liballoc/../liballoc/benches/slice.rs:201:42
    |
201 |     let mut rng = XorShiftRng::from_seed([0, 1, 2, 3]);
    |                                          ^^^^^^^^^^^^ expected an array with a fixed size of 16 elements, found one with 4 elements
    |
    = note: expected type `[u8; 16]`
               found type `[u8; 4]`
error: use of deprecated item 'rand::Rng::gen_iter': use Rng::sample_iter(&Standard) instead
   --> liballoc/../liballoc/benches/slice.rs:202:9
    |
202 |     rng.gen_iter::<u8>().take(len).collect()
    |         ^^^^^^^^
error[E0308]: mismatched types
   --> liballoc/../liballoc/benches/slice.rs:206:42
    |
206 |     let mut rng = XorShiftRng::from_seed([0, 1, 2, 3]);
    |                                          ^^^^^^^^^^^^ expected an array with a fixed size of 16 elements, found one with 4 elements
    |
    = note: expected type `[u8; 16]`
               found type `[u8; 4]`
error[E0308]: mismatched types
   --> liballoc/../liballoc/benches/slice.rs:217:42
    |
217 |     let mut rng = XorShiftRng::from_seed([0, 1, 2, 3]);
    |                                          ^^^^^^^^^^^^ expected an array with a fixed size of 16 elements, found one with 4 elements
    |
    = note: expected type `[u8; 16]`
               found type `[u8; 4]`
error[E0308]: mismatched types
   --> liballoc/../liballoc/benches/slice.rs:228:42
    |
228 |     let mut rng = XorShiftRng::from_seed([0, 1, 2, 3]);
    |                                          ^^^^^^^^^^^^ expected an array with a fixed size of 16 elements, found one with 4 elements
    |
    = note: expected type `[u8; 16]`
               found type `[u8; 4]`
error: use of deprecated item 'rand::Rng::gen_ascii_chars': use sample_iter(&Alphanumeric) instead
   --> liballoc/../liballoc/benches/slice.rs:232:20
    |
232 |         v.push(rng.gen_ascii_chars().take(n).collect());
    |                    ^^^^^^^^^^^^^^^
error[E0308]: mismatched types
   --> liballoc/../liballoc/benches/slice.rs:238:42
    |
238 |     let mut rng = XorShiftRng::from_seed([0, 1, 2, 3]);
    |                                          ^^^^^^^^^^^^ expected an array with a fixed size of 16 elements, found one with 4 elements
    |
    = note: expected type `[u8; 16]`
               found type `[u8; 4]`
error: use of deprecated item 'rand::Rng::gen_iter': use Rng::sample_iter(&Standard) instead
   --> liballoc/../liballoc/benches/slice.rs:239:9
    |
239 |     rng.gen_iter().map(|x| [x; 16]).take(len).collect()
    |         ^^^^^^^^
error: aborting due to 10 previous errors
For more information about this error, try `rustc --explain E0308`.
error: Could not compile `alloc`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions