From bcffa71e357d3a0f4ce886444307b3c46cbbbbc7 Mon Sep 17 00:00:00 2001 From: "carpentry-heartbeat[bot]" Date: Sun, 16 Aug 2026 01:19:01 +0200 Subject: [PATCH] Mark the discarded read-line results as deliberate discards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit angler grew an unused-let-binding rule after bufio's last green run, and it fires twice on test/bufio.carp: 'first-line' is bound but never read. The binding is dead, the call is not — (BufReader.read-line &br) advances the reader so the following read returns the second line, which is what both assertions pin. Prefixing the name with an underscore is angler's own exemption for a deliberate discard (binding-name in angler.carp), the same spelling core's 'ignore' macro expands to. The call, its position in the binding list and its drop point are all unchanged: the generated C differs only in the four lines that name the variable. --- test/bufio.carp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/bufio.carp b/test/bufio.carp index 3f27b74..b063e73 100644 --- a/test/bufio.carp +++ b/test/bufio.carp @@ -27,7 +27,7 @@ world " &(let-do [br (mock-bufreader-create "hello world " 0) - first-line (BufReader.read-line &br) + _first-line (BufReader.read-line &br) r (BufReader.read-line &br)] (BufReader.delete br) (mock-cleanup) (match r (Result.Success s) s (Result.Error _) @"ERROR")) "read-line returns second line") @@ -145,7 +145,7 @@ world &(let-do [br (mock-bufreader-create "first second " 0) - first-line (BufReader.read-line &br)] (BufReader.clear-read &br) (let-do [r (BufReader.read-line &br)] + _first-line (BufReader.read-line &br)] (BufReader.clear-read &br) (let-do [r (BufReader.read-line &br)] (BufReader.delete br) (mock-cleanup) (match r (Result.Success _) @"UNEXPECTED" (Result.Error e) e)))