How to run nightly test crate with personal modification

Run benchmark through "cargo +nightly bench" which leverages the unstable feature test::{black_box, bencher}. I'd like to make some modifications in test::bencher to print more running information, so I fork GitHub - messense/rustc-test: A fork of Rust’s `test` crate that doesn’t require unstable language features. without any change yet, and specify my own link in Cargo.toml. But it's then failed to run cargo +nightly bench, with messages as following:

error[E0433]: failed to resolve: could not find TestType in test
--> boringtun/benches/
14 | #[bench]
| -------- in this procedural macro expansion
15 | / fn bench_x25519_public_key(b: &mut Bencher) {
16 | | let secret_key = X25519SecretKey::new();
17 | |
18 | | b.iter(|| {
19 | | black_box(secret_key.public_key());
20 | | });
21 | | }
| |_____^ could not find TestType in test
= note: this error originates in the attribute macro bench (in Nightly builds, run with -Z macro-backtrace for more info)

Does anyone know how to fix it?

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.