Rules / TAU-U001

No unsafe outside the edge

decided by Rustc kernel deny core deny edge –
Applies to tests: yes Exceptions: never

Why

Every guarantee in this profile assumes safe Rust.

Fix

Move the unsafe code into an edge crate (or a dedicated -sys crate) behind a safe, documented API.

What it checks

Lints: unsafe_code

Seen in fixtures

rej-unsafe/src/lib.rs core

//! Unsafe in core. /// Read through a pointer.#[must_use]pub fn read(x: &u8) -> u8 {    // SAFETY: x is a valid reference.    unsafe { core::ptr::read(x) }}

$ cargo tauten check

error[TAU-U001]: usage of an `unsafe` block  --> rej-unsafe/src/lib.rs:7:5 (core crate `rej-unsafe`)  = rule: No unsafe outside the edge (decided by Rustc)  = fix: Move the unsafe code into an edge crate (or a dedicated `-sys` crate) behind a safe, documented API.
Fixture rej-unsafe (core) expects TAU-U001. Output captured at 0200db3.

In the terminal

cargo tauten explain TAU-U001

$ cargo tauten explain TAU-U001

TAU-U001: No unsafe outside the edge Why: Every guarantee in this profile assumes safe Rust. Fix: Move the unsafe code into an edge crate (or a dedicated `-sys` crate) behind a safe, documented API. Decided by: RustcDecides: No `unsafe` code outside the edge.Sees: resolved; complete: yesDoes not see: Code expanded from macros defined in other crates (clippy skips it); code disabled by `cfg`; build scripts.Applies to tests: yesExceptions allowed: never  kernel deny  core deny  edge -Lints: unsafe_code