Rust Safety.instructions
---
description: Microsoft Rust guidelines for unsafe code and soundness — unsafe implies UB risk, unsafe needs justification, all code must be sound. Enforced on all Rust source files.
applyTo: "**/*.rs"
---
# Rust Safety Guidelines (Microsoft Pragmatic Rust)
## Unsafe Implies Undefined Behavior (M-UNSAFE-IMPLIES-UB)
The marker `unsafe` may only be applied to functions and traits if misuse
implies the risk of undefined behavior (UB). It must not be used to mark
functions that are dangerous to call for other reasons.when to use it
Community prompt sourced from the open-source GitHub repo pngdeity/apm-user-repository (MIT). A "Rust Safety.instructions" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
roleplaycommunitygeneral
source
pngdeity/apm-user-repository · MIT