#[test]
fn workspace_lints_keep_linker_messages_allowed() {
let manifest_path = concat!(env!("CARGO_MANIFEST_DIR"), "/Cargo.toml");
let manifest = std::fs::read_to_string(manifest_path).expect("read root Cargo.toml");
let parsed: toml::Table = manifest.parse().expect("parse root Cargo.toml as TOML");
let linker_messages = parsed
.get("workspace")
.and_then(|w| w.get("lints"))
.and_then(|l| l.get("rust"))
.and_then(|r| r.get("linker_messages"))
.and_then(|v| v.as_str());
assert_eq!(
linker_messages,
Some("allow"),
"workspace.lints.rust.linker_messages must stay \"allow\" (see #5961, #5895): \
it suppresses Apple ld's arm64-only __eh_frame section warning that \
build.warnings = \"deny\" (.cargo/config.toml) would otherwise escalate to a hard \
build failure on macOS/arm64. ci.yml (the PR/push gate) is Linux-only and cannot \
detect this in the linker itself — this test is the only automated per-PR guard. \
Do not remove this assertion without re-reading #5961."
);
}