Date
2026-07-23
Read
2 min
Topic
rust
rust · meta · tooling

Showing real terminal output in a post, not paraphrasing it

2026-07-232 min readrust

Most technical posts paraphrase what happened: "and then I got a borrow-checker error." Here's the actual error, captured with cargo build --color=always 2>&1 and pasted straight in — same colors the terminal gave me, not a screenshot, not retyped by hand.

terminal
1error[E0502]: cannot borrow `self.ring` as mutable because it is also borrowed as immutable2  --> src/ring.rs:88:93   |486 |     let existing = self.ring.get(&token);5   |                    --------- immutable borrow occurs here687 |     if existing.is_none() {788 |         self.ring.insert(token, node);8   |         ^^^^^^^^^ mutable borrow occurs here989 |     }10   |     - immutable borrow later used here

The fix was dropping existing before the insert — obvious in hindsight, not obvious at 11pm. Once that clicked, the fleet's rebalance test went from a hang to green:

terminal
1running 3 tests2test ring::tests::vnode_migration_is_bounded ... ok3test ring::tests::join_moves_one_over_n_keys ... ok4test ring::tests::leave_redistributes_to_neighbors ... FLAKY, retrying5test ring::tests::leave_redistributes_to_neighbors ... ok6 7test result: ok. 3 passed; 0 failed; 0 ignored; finished in 0.41s

Two things make this worth having as its own fence instead of a plain ```bash block: the color is real ANSI (\x1b[31m, `\x1b[1m`, …) converted through the site's own theme tokens — `\x1b[31m` renders as `var(--red)`, not a fixed hex, so it still reads correctly on every theme this site ships, light or dark. And the copy button copies the plain text a reader would actually want — no escape bytes — even though the block itself is real, unedited output.

Comments
Loading comments…