From f981a1fc6e525faf7bd5f99e4b76cb7888091a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralph=20K=C3=BCpper?= Date: Tue, 4 Aug 2026 11:09:04 +0200 Subject: [PATCH] style: restore rustfmt on linker.rs, red on main since #7355 `cargo fmt --all -- --check` exits 1 on main HEAD (7428437e4). One file: `crates/perry-codegen/src/linker.rs`, where `rs4gc_funclet_refusal`'s needle array crossed the width that makes rustfmt break it vertically. `lint` is a REQUIRED context. A required check that is red on main does not block anything -- it means every subsequent merge is a bypass, which is the hazard CLAUDE.md lists and that this repo has already paid for once (lint sat red across three nightlies on 16 oversized files, and every merge in that window went in unchecked). No behavior change: whitespace only. Claude-Session: https://claude.ai/code/session_01EaD6yNwoinzdW1JbYNkMMF --- crates/perry-codegen/src/linker.rs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/crates/perry-codegen/src/linker.rs b/crates/perry-codegen/src/linker.rs index 072a864d22..070d36c01e 100644 --- a/crates/perry-codegen/src/linker.rs +++ b/crates/perry-codegen/src/linker.rs @@ -511,19 +511,23 @@ fn build_clang_compile_plan( /// Matched on the ` within ` instruction syntax rather than the bare opcode /// names so a user string literal containing "catchpad" cannot trip it. pub(crate) fn rs4gc_funclet_refusal(ll_text: &str) -> Option { - ["catchswitch within ", "catchpad within ", "cleanuppad within "] - .iter() - .any(|needle| ll_text.contains(needle)) - .then(|| { - "PERRY_RS4GC: this module contains a `try`/`catch` that lowered to \ + [ + "catchswitch within ", + "catchpad within ", + "cleanuppad within ", + ] + .iter() + .any(|needle| ll_text.contains(needle)) + .then(|| { + "PERRY_RS4GC: this module contains a `try`/`catch` that lowered to \ WinEH funclet pads (catchswitch/catchpad — the windows-msvc EH \ shape), and LLVM's rewrite-statepoints-for-gc pass does not \ support funclet EH: it crashes with an access violation rather \ than reporting anything. Refusing before the pass runs. \ Compile without PERRY_RS4GC, or keep `try` out of RS4GC-compiled \ modules on Windows. Tracked in #7354." - .to_string() - }) + .to_string() + }) } fn maybe_rs4gc_preprocess(ll_text: &str) -> Result> { @@ -584,10 +588,7 @@ fn maybe_rs4gc_preprocess(ll_text: &str) -> Result> { // left only a symbol-less stack dump. Write the exact input next to // the other failure artifacts and name it, so the crash is // reproducible with one command. - let ir_path = env::temp_dir().join(format!( - "perry_rs4gc_failed_{}.ll", - std::process::id() - )); + let ir_path = env::temp_dir().join(format!("perry_rs4gc_failed_{}.ll", std::process::id())); let ir_note = match fs::write(&ir_path, ll_text) { Ok(()) => format!("input IR left at: {}", ir_path.display()), Err(error) => format!("(could not write input IR: {error})"),