Commit 38129e5
committed
fix(reentrancy): make GuardCount unforgeable, widen the local rustdoc gate
`GuardCount` was a fieldless unit struct, so any code able to name it could
construct one -- and therefore drop one. `Drop` decrements the thread-local,
so a stray `drop(GuardCount)` while a tracked guard was live took the count to
zero, `assert_no_guards_held` then passed, and a genuine callback-under-lock
went unreported. `saturating_sub` made that desync permanently silent. A
private field means only this module can mint one, so the count moves only by
acquiring and releasing a real guard. The module docs called it a unit struct;
they now say zero-sized newtype.
`check-local.nu`'s rustdoc gate matched only `unresolved link`, while
`check-local.sh:95` -- what CI runs -- also matches `broken_intra_doc_links`.
A diagnostic carrying the lint name but not that phrase passed locally and
failed remotely, which is the specific way this gate has already wasted CI
cycles on this branch series. Both patterns now, as the shell gate does.
No behaviour change: the four `reentrancy::tests` still pass, including
`assert_fires_while_a_guard_is_live`, which is the one that proves the counter
still detects.1 parent 9bc6dfd commit 38129e5
2 files changed
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
60 | 69 | | |
61 | | - | |
| 70 | + | |
62 | 71 | | |
63 | 72 | | |
64 | 73 | | |
65 | 74 | | |
66 | 75 | | |
67 | 76 | | |
68 | | - | |
| 77 | + | |
69 | 78 | | |
70 | 79 | | |
71 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
0 commit comments