diff --git a/crates/design-lint/src/contract/unsafe_allow.rs b/crates/design-lint/src/contract/unsafe_allow.rs index 05015af3b..71fb022fd 100644 --- a/crates/design-lint/src/contract/unsafe_allow.rs +++ b/crates/design-lint/src/contract/unsafe_allow.rs @@ -1,5 +1,5 @@ -//! `contract/unsafe-allow`: no `allow(unsafe_code)` in source, except in craft-win32 and the benchmark's allocator -//! (`ALLOWED`). Every other crate keeps the workspace `forbid`. +//! `contract/unsafe-allow`: no `allow(unsafe_code)` in source, except in the platform crates craft-win32, craft-appkit +//! and craft-wayland and in the benchmark's allocator (`ALLOWED`). Every other crate keeps the workspace `forbid`. use std::path::Path; @@ -13,9 +13,9 @@ use super::Cx; pub const ID: &str = "contract/unsafe-allow"; /// The places that may allow `unsafe_code`, as path prefixes relative to the repository root, as in findings: -/// craft-win32, which holds the Windows FFI calls (the owner's exception, 2026-11-08), and the benchmark's global -/// allocator. -pub(crate) const ALLOWED: [&str; 2] = ["crates/win32/src", "crates/ui-bench/src/alloc.rs"]; +/// craft-win32, which holds the Windows FFI calls (the owner's exception, 2026-11-08), craft-appkit and craft-wayland, +/// which hold the macOS and Wayland ones, and the benchmark's global allocator. +pub(crate) const ALLOWED: [&str; 4] = ["crates/win32/src", "crates/appkit/src", "crates/wayland/src", "crates/ui-bench/src/alloc.rs"]; struct Allows { spans: Vec, @@ -42,6 +42,12 @@ pub(super) fn check(cx: &Cx<'_>, out: &mut Vec) { let mut allows = Allows { spans: Vec::new() }; allows.visit_file(cx.file); for span in allows.spans { - cx.flag_span(out, ID, ID, span, "`allow(unsafe_code)`; only craft-win32 and the benchmark allocator allow it".to_owned()); + cx.flag_span( + out, + ID, + ID, + span, + "`allow(unsafe_code)`; only craft-win32, craft-appkit, craft-wayland and the benchmark allocator allow it".to_owned(), + ); } }