Skip to content

Commit 7f03948

Browse files
hyperpolymathclaude
andcommitted
chore: add #![forbid(unsafe_code)] to safe Rust crates
Adds the forbid(unsafe_code) crate-level attribute to all Rust crates that do not use unsafe code, hardening the safety guarantee at compile time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent efb6632 commit 7f03948

9 files changed

Lines changed: 9 additions & 0 deletions

File tree

crates/anv-cli/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
//! - Running programs
1010
//! - Generating visualizations
1111
12+
#![forbid(unsafe_code)]
1213
use anv_core::source::FileId;
1314
use anv_ir::lower;
1415
use anv_semantics::{validate_program, Discipline};

crates/anv-core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//! Anvomidav compiler and runtime, including skating-specific primitives,
88
//! source locations, and diagnostics.
99
10+
#![forbid(unsafe_code)]
1011
pub mod diagnostics;
1112
pub mod skating;
1213
pub mod source;

crates/anv-debug/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//! Provides REPL-based debugging with breakpoints, variable inspection,
77
//! timeline visualization, and ISU code validation.
88
9+
#![forbid(unsafe_code)]
910
use rustyline::error::ReadlineError;
1011
use rustyline::DefaultEditor;
1112
use std::collections::HashMap;

crates/anv-ir/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
//! let choreography = lower_to_choreo(&timeline);
5151
//! ```
5252
53+
#![forbid(unsafe_code)]
5354
pub mod choreo;
5455
pub mod choreo_lower;
5556
pub mod lower;

crates/anv-lsp/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
// Anvomidav LSP library
33

4+
#![forbid(unsafe_code)]
45
pub mod backend;
56
pub mod document;
67
pub mod handlers;

crates/anv-semantics/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
//! let errors = validate_program(&program, Discipline::MenSingles);
2626
//! ```
2727
28+
#![forbid(unsafe_code)]
2829
pub mod rules;
2930
pub mod validate;
3031

crates/anv-syntax/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
//! assert!(result.is_ok());
3131
//! ```
3232
33+
#![forbid(unsafe_code)]
3334
pub mod ast;
3435
pub mod format;
3536
pub mod parser;

crates/anv-types/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
//! assert!(result.is_ok());
3333
//! ```
3434
35+
#![forbid(unsafe_code)]
3536
pub mod check;
3637
pub mod env;
3738
pub mod ty;

crates/anv-viz/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
//! .render(&timeline);
2020
//! ```
2121
22+
#![forbid(unsafe_code)]
2223
pub mod rink_svg;
2324
pub mod timeline_svg;
2425

0 commit comments

Comments
 (0)