Checklist
- Universal
- Follow the Upstream Guidelines (M-UPSTREAM-GUIDELINES)
- Use Static Verification (M-STATIC-VERIFICATION)
-
Lint Overrides Should Use
#[expect]
(M-LINT-OVERRIDE-EXPECT) - Public Types are Debug (M-PUBLIC-DEBUG)
- Public Types Meant to be Read are Display (M-PUBLIC-DISPLAY)
- If in Doubt, Split the Crate (M-SMALLER-CRATES)
- Names are Free of Weasel Words (M-CONCISE-NAMES)
- Prefer Regular over Associated Functions (M-REGULAR-FN)
- Panic Means 'Stop the Program' (M-PANIC-IS-STOP)
- Detected Programming Bugs are Panics, Not Errors (M-PANIC-ON-BUG)
- All Magic Values and Behaviors are Documented (M-DOCUMENTED-MAGIC)
- Library / Interoperability
- Types are Send (M-TYPES-SEND)
- Native Escape Hatches (M-ESCAPE-HATCHES)
- Don't Leak External Types (M-DONT-LEAK-TYPES)
- Library / UX
- Abstractions Don't Visibly Nest (M-SIMPLE-ABSTRACTIONS)
- Avoid Smart Pointers and Wrappers in APIs (M-AVOID-WRAPPERS)
- Prefer Types over Generics, Generics over Dyn Traits (M-DI-HIERARCHY)
- Error are Canonical Structs (M-ERRORS-CANONICAL-STRUCTS)
- Complex Type Construction has Builders (M-INIT-BUILDER)
- Complex Type Initialization Hierarchies are Cascaded (M-INIT-CASCADED)
- Services are Clone (M-SERVICES-CLONE)
-
Accept
impl AsRef<>
Where Feasible (M-IMPL-ASREF) -
Accept
impl RangeBounds<>
Where Feasible (M-IMPL-RANGEBOUNDS) -
Accept
impl 'IO'
Where Feasible ('Sans IO') (M-IMPL-IO) - Essential Functionality Should be Inherent (M-ESSENTIAL-FN-INHERENT)
- Library / Resilience
- I/O and System Calls Are Mockable (M-MOCKABLE-SYSCALLS)
- Test Utilities are Feature Gated (M-TEST-UTIL)
- Use the Proper Type Family (M-STRONG-TYPES)
- Don't Glob Re-Export Items (M-NO-GLOB-REEXPORTS)
- Avoid Statics (M-AVOID-STATICS)
- Library / Building
- Libraries Work Out of the Box (M-OOBE)
-
Native
-sys
Crates Compile Without Dependencies (M-SYS-CRATES) - Features are Additive (M-FEATURES-ADDITIVE)
- Applications
- Use Mimalloc for Apps (M-MIMALLOC-APP)
- Applications may use Anyhow or Derivatives (M-APP-ERROR)
- FFI
- Isolate DLL State Between FFI Libraries (M-ISOLATE-DLL-STATE)
- Safety
- Unsafe Needs Reason, Should be Avoided (M-UNSAFE)
- Unsafe Implies Undefined Behavior (M-UNSAFE-IMPLIES-UB)
- All Code Must be Sound (M-UNSOUND)
- Performance
- Optimize for Throughput, Avoid Empty Cycles (M-THROUGHPUT)
- Identify, Profile, Optimize the Hot Path Early (M-HOTPATH)
- Long-Running Tasks Should Have Yield Points. (M-YIELD-POINTS)
- Documentation
- First Sentence is One Line; Approx. 15 Words (M-FIRST-DOC-SENTENCE)
- Has Module Documentation (M-MODULE-DOCS)
- Documentation Has Canonical Sections (M-CANONICAL-DOCS)
-
Mark
pub use
Items with#[doc(inline)]
(M-DOC-INLINE)
- AI
- Design with AI use in Mind (M-DESIGN-FOR-AI)