Skip to content

Commit 238af47

Browse files
fix(compiler/phronesis-ast): move stranded #![forbid(unsafe_code)] to crate top (#49)
`#![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) <noreply@anthropic.com>
1 parent 395f8c8 commit 238af47

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • compiler/phronesis-ast/src

compiler/phronesis-ast/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
33
// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell
44

5+
#![forbid(unsafe_code)]
6+
57
//! Abstract syntax tree definitions for the Phronesis policy language.
68
//!
79
//! Phronesis is a provably-terminating policy DSL for ethical/agentic reasoning.
@@ -31,7 +33,6 @@
3133
/// Byte offsets are `u32` because Phronesis policy files are expected to be
3234
/// well under 4 GiB. The `synthetic` constructor produces a zero-length span
3335
/// for compiler-generated nodes that have no corresponding source text.
34-
#![forbid(unsafe_code)]
3536
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
3637
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3738
pub struct Span {

0 commit comments

Comments
 (0)