知识卡片
无标准库支持需验证传递依赖
本crate不用std仍可能经依赖引入它,桌面构建成功不能证明裸机兼容。应在明确无std的目标检查支持配置,并用std或alloc等正向feature启用额外能力。不要用no_std开关去移除别人需要的功能,依赖功能合并会让这种负向语义难以协调。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 6. Beyond Standard Rust Writing Code for no_std · 查看原书依据
Writing Code for no_std The previous sections made it clear that for some library crates, making the code no_std compatible just involves the following: Replacing std:: types with identical core:: or alloc:: crates (which requires use of the full type name, due to the absence of the std prelude) Shifting from HashMap/HashSet to BTreeMap/BTreeSet However, thi
参考来源
- 位置:《Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)》第6章《Writing Code for no_std》(spine10;extracted/Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)/_epub-src/OEBPS/ch06.html;u170-ch06-005)。
- 结论依据:原文在“Writing Code for no_std”附近的定义、例子或代码支撑本卡核心说明:本crate不用std仍可能经依赖引入它,桌面构建成功不能证明裸机兼容。边界按已读前提解释;示例未执行。
- 原始内容:Writing Code for no_std The previous sections made it clear that for some library crates, making the code no_std compatible just involves the following: Replacing std:: types with identical core:: or alloc:: crates (which requires use of the full type name, due to the absence of the std prelude) Shifting from HashMap/HashSet to BTreeMap/BTreeSet However, thi