知识卡片
解释执行补充不安全代码诊断
Miri解释编译器中间表示,可发现某些普通编译检查未指出的错误,适合辅助诊断unsafe代码。它覆盖的是所执行路径与模型,不会证明所有输入、并发交错或FFI实现都正确。使用前需核对工具支持范围,并把发现的条件转为可复现证据。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 3. Concepts Item 16: Avoid writing unsafe code · 查看原书依据
Miri interprets the intermediate level output from the compiler, that allows it to detect classes of errors that are invisible to the Rust compiler. Think carefully about multithreaded use, particularly if there’s shared state (Item 17). Adding the unsafe marker doesn’t mean that no rules apply—it means that you (the programmer) are now responsible for maint
参考来源
- 位置:《Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)》第3章《Item 16: Avoid writing unsafe code》(spine7;extracted/Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)/_epub-src/OEBPS/ch03.html;u098-ch03-053)。
- 结论依据:原文在“Miri interprets”附近的定义、例子或代码支撑本卡核心说明:Miri解释编译器中间表示,可发现某些普通编译检查未指出的错误,适合辅助诊断unsafe代码。边界按已读前提解释;示例未执行。
- 原始内容:Miri interprets the intermediate level output from the compiler, that allows it to detect classes of errors that are invisible to the Rust compiler. Think carefully about multithreaded use, particularly if there’s shared state (Item 17). Adding the unsafe marker doesn’t mean that no rules apply—it means that you (the programmer) are now responsible for maint