Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Teaches agents to isolate and review unsafe Rust behind small, documented safe wrappers with explicit invariants and Miri checks.
Use this skill ↓50% 86%+36 ptsof test cases passed
Passed 19 of 22 test cases with the skill, and 11 of 22 without it.
I am writing a Rust function `free_raw_node<T>(ptr: *mut Node<T>)` that reclaims memory allocated by `Box::into_raw`. Provide the function definition including doc comments and internal memory deallocation.
The Box::from_raw call is wrapped in an explicit unsafe block with a // SAFETY: comment.
3 of 3 safety checks passed
Use this skill to isolate unsafe Rust behind small, documented, testable boundaries. Unsafe code is acceptable only when a safe API cannot express the needed operation with acceptable correctness and performance.
// SAFETY: comment immediately before each unsafe block explaining
why every unsafe operation inside is valid.unsafe fn only when callers must uphold extra conditions.
Document those conditions in a # Safety section.unsafe_op_in_unsafe_fn; unsafe operations inside unsafe
functions should still be wrapped in explicit unsafe blocks.Read references/safety-invariants.md before adding or approving unsafe code.
MaybeUninit<T> over deprecated or ad hoc uninitialized memory
patterns.set_len, pointer arithmetic, or from_raw_parts without proving
capacity, initialization, and ownership.static mut; prefer OnceLock, LazyLock, atomics, or locked state.Next to this one in the catalogue, plus more from the same author.