The benchmark Error in RUST Standard Library vec_deque_append

Hello everyone.

I want to benchmark in rust standard library vec_deque.
I proceed the benchmark to standard library vec_deque in rust git repository (https://github.com/rust-lang/rust/tree/1.64.0/library/alloc)

I use the following environment setting:

  1. Compiler : rustc 1.64.0-nightly (94f8ee1f7 2022-07-11)
  2. Becnhmark Path: rust/library/alloc
  3. Commend : cargo bench -- --vec_deque_append_bench

However, I meet the error like below :

error[E0599]: the method `iter` exists for reference `&set::BTreeSet<T>`, but its trait bounds were not satisfied
   --> library/alloc/src/collections/btree/set/tests.rs:596:11
    |
596 |         v.iter()
    |           ^^^^ method cannot be called on `&set::BTreeSet<T>` due to unsatisfied trait bounds
    |
   ::: /home/wldns190/s2fuzz/scripts/rust/library/alloc/src/alloc.rs:52:1
    |
52  | pub struct Global;
    | -----------------
    | |
    | doesn't satisfy `std::alloc::Global: core::alloc::Allocator`
    | doesn't satisfy `std::alloc::Global: core::clone::Clone`
    |
    = note: the following trait bounds were not satisfied:
            `std::alloc::Global: core::alloc::Allocator`
            `std::alloc::Global: core::clone::Clone`

error[E0599]: the method `into_iter` exists for struct `set::BTreeSet<T>`, but its trait bounds were not satisfied
   --> library/alloc/src/collections/btree/set/tests.rs:600:11
    |
600 |         v.into_iter()
    |           ^^^^^^^^^ method cannot be called on `set::BTreeSet<T>` due to unsatisfied trait bounds
    |
   ::: library/alloc/src/collections/btree/set.rs:81:12
    |
81  | pub struct BTreeSet<
    |            -------- method `into_iter` not found for this struct
    |
    = note: the following trait bounds were not satisfied:
            `&mut set::BTreeSet<T>: core::marker::Sized`
            which is required by `&mut set::BTreeSet<T>: core::iter::IntoIterator`
            `&mut set::BTreeSet<T>: core::iter::Iterator`
            which is required by `&mut set::BTreeSet<T>: core::iter::IntoIterator`

I think that the library in rust compiler git repository is stable to test. But, there are some issues to proceed the benchmark. Is there any solution??

Have a nice day:)

If you are working in the rust repository you probably want to use x.py to compile.

The About this Guide - Standard library developers Guide describes how to build, test and benchmark the standard library. It requires that you understand the basics from the Rust Compiler Development Guide.

There you find ./x bench library/<lib> --stage 0 --test-args <benchmark name> for a stage 0 based test. Be sure to read the rustc guide to understand what that means :slight_smile:

1 Like

Thank you for your comment! I can perform the benchmark!

Then, I just wonder that if we use the benchmark commend like ./x bench library/ --stage 0 --test-args , then it re-build the rust compiler so there are so many times to build all rust compiler. I just want to build the library to proceed the benchmark and run the benchmark.

Then, how can i proceed the benchmark?? Thank you!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.