Commit f4bf5f8
fix(terraphim_tinyclaw): add SAFETY comment to unsafe set_var in test Refs #2492
`crates/terraphim_tinyclaw/src/config.rs:619` used an `unsafe` block around
`std::env::set_var("TEST_VAR", ...)` without a `// SAFETY:` comment documenting
the invariant. `set_var` is unsafe because concurrent environment reads from
other threads can race with the write.
Add the required SAFETY comment with an accurate invariant: no other test in
this binary reads or writes `TEST_VAR` (verified by grep — the symbol appears
only in this test). This matches the pattern established for
`terraphim_symphony` (#2497, PR #2865) and corrects the imprecise
"single-threaded" claim of the prior stranded commit, since cargo runs tests in
parallel threads by default.
Comment-only change (+3 lines, zero executable code changed).
Verification (all exit 0):
- cargo fmt -p terraphim_tinyclaw -- --check
- cargo clippy -p terraphim_tinyclaw --lib --tests -- -D warnings
- cargo test -p terraphim_tinyclaw --lib (174 passed, 0 failed)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 61b5e37 commit f4bf5f8
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
619 | 622 | | |
620 | 623 | | |
621 | 624 | | |
| |||
0 commit comments