Rust Benchmark (Vec)


I have encountered an unexpected error while attempting to benchmark vec and have a question about it. To use the file located in rust/library/alloc/benches , I added the following code to my Cargo.toml :

name = "vec_bench"
path = "benches/"
harness = false

However, I am encountering the following error.

If anyone has experienced and resolved a similar issue or has succeeded in benchmarking, I would appreciate it if you could provide guidance.

my Rust version is rustc 1.74.0-nightly (9f5fc1bd4 2023-09-02) .

The repository with the Rust compiler works differently from ordinary cargo in normal projects. See this guide. I recommend that you create a separate project outside of the Rust compiler and do your benchmark there.


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.