AGENT SKILL

lang-rust

Safe Rust by default, borrow checker compliance, miri validation of unsafe blocks, clippy -D warnings, and explicit error handling via Result/Option.

License 许可
MIT
所属仓库
WASDst/photoshow
最近更新
2026-10-08
Stars
★ 0
Forks
0

01 前言 Front Matter

name
lang-rust
description
Safe Rust by default, borrow checker compliance, miri validation of unsafe blocks, clippy -D warnings, and explicit error handling via Result/Option.

02 资源文件 6

03 SKILL.md 正文

Rust Safe-by-Default Contract

1. Safe by Default & Unsafe Quarantine

  • Production code must be #![forbid(unsafe_code)] unless an explicit waiver is registered in .prumo/escape-hatches.json.
  • Any required unsafe block must state its safety invariants with // SAFETY: and be tested under cargo miri.

2. Error Handling & Unwraps

  • Prohibit .unwrap() and .expect() in non-test paths. Propagate errors via ? operator or return typed errors using thiserror.
  • Compile with cargo clippy --all-targets -- -D warnings.

04 同仓库更多 Skills