From 849a0a332c0aa6f6046030105aa2108a70b7ce19 Mon Sep 17 00:00:00 2001 From: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> Date: Mon, 15 Jun 2026 16:30:38 +0100 Subject: [PATCH] fix(compiler/phronesis-ast): move stranded #![forbid(unsafe_code)] to crate top MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `#![forbid(unsafe_code)]` is a crate-level *inner* attribute but was left mid-file (line 34, between a doc comment and `struct Span`) — the residue of a botched merge resolution. Rust rejects an inner attribute there ("the inner attribute doesn't annotate this struct"), so `phronesis-ast` failed to compile and its unit tests never ran. Moved the attribute to the top of the file (after the SPDX header, before the module docs). `cargo build` succeeds and `cargo test` passes 21/21. SPDX header left unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) --- compiler/phronesis-ast/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/phronesis-ast/src/lib.rs b/compiler/phronesis-ast/src/lib.rs index 7889242..362efca 100644 --- a/compiler/phronesis-ast/src/lib.rs +++ b/compiler/phronesis-ast/src/lib.rs @@ -2,6 +2,8 @@ // Copyright (c) Jonathan D.A. Jewell // SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +#![forbid(unsafe_code)] + //! Abstract syntax tree definitions for the Phronesis policy language. //! //! Phronesis is a provably-terminating policy DSL for ethical/agentic reasoning. @@ -31,7 +33,6 @@ /// Byte offsets are `u32` because Phronesis policy files are expected to be /// well under 4 GiB. The `synthetic` constructor produces a zero-length span /// for compiler-generated nodes that have no corresponding source text. -#![forbid(unsafe_code)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Span {