【发布时间】:2021-02-06 09:30:57
【问题描述】:
我在项目的cargo.toml 中添加了以下几行,以便对我的代码进行基准测试:
[dev-dependencies]
criterion = "0.3"
[[bench]]
name = "samples"
harness = false
运行cargo bench 后,我收到很多类似以下的错误:
Compiling criterion v0.3.4
error[E0603]: module `export` is private
--> C:\Development\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\criterion-0.3.4\src\connection.rs:201:17
|
201 | #[derive(Debug, Deserialize)]
| ^^^^^^^^^^^ private module
|
note: the module `export` is defined here
--> C:\Development\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\serde-1.0.123\src\lib.rs:275:5
|
275 | use self::__private as export;
错误消息在我看来serde 和criterion 之间存在问题。但是我在两个项目问题中都没有发现这个错误信息,所以我的工作区可能有隐藏的原因。
一些附加信息:
- 项目是使用 nightly 工具链编译的
-
cargo.toml中只有一个显式依赖项(proc 宏),它传递引用syn、quote和proc-macro2
【问题讨论】:
标签: rust rust-cargo serde rust-criterion