我正在尝试使用 bincode crate。由于它是默认功能,它使用标准库,但我正在
no_std
环境中工作。我已将 default-features = false
添加到我的 Cargo.toml 中,但它仍然无法编译。
我的依赖:
[package]
name = "fsys"
version = "0.1.0"
edition = "2021"
[dependencies]
bincode = { version = "1.3.3", default-features = false}
这对我来说没有任何意义。
std
的 bincode
功能被禁用,但它仍然尝试构建与标准库的依赖关系。
这是错误消息的简短版本:
Compiling serde v1.0.182
error[E0463]: can't find crate for `std`
|
= note: the `x86_64-cos` target may not support the standard library
= note: `std` is required by `serde` because it does not declare `#![no_std]`
= help: consider building the standard library from source with `cargo build -Zbuild-std`
最初的错误消息是这样的,但后面是 20K 行失败的
std
导入。