about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/parser-slice-array.js
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-01-09 14:39:22 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-01-11 07:56:20 +1100
commit56c3265c7b2e995f5518bc2554a6018678d273a6 (patch)
tree9bd6aa8d1ff8760d5a76f9f68adc18ae47c67131 /tests/rustdoc-js-std/parser-slice-array.js
parent8866780d02d8350607b28c909272a1203f8d7641 (diff)
downloadrust-56c3265c7b2e995f5518bc2554a6018678d273a6.tar.gz
rust-56c3265c7b2e995f5518bc2554a6018678d273a6.zip
Replace `warn_count`.
There are four functions that adjust error and warning counts:
- `stash_diagnostic` (increment)
- `steal_diagnostic` (decrement)
- `emit_stashed_diagnostics) (decrement)
- `emit_diagnostic` (increment)

The first three all behave similarly, and only update `warn_count` for
forced warnings. But the last one updates `warn_count` for both forced
and non-forced warnings.

Seems like a bug. How should it be fixed? Well, `warn_count` is only
used in one place: `DiagCtxtInner::drop`, where it's part of the
condition relating to the printing of `good_path_delayed_bugs`. The
intention of that condition seems to be "have any errors been printed?"
so this commit replaces `warn_count` with `has_printed`, which is set
when printing occurs. This is simpler than all the ahead-of-time
incrementing and decrementing.
Diffstat (limited to 'tests/rustdoc-js-std/parser-slice-array.js')
0 files changed, 0 insertions, 0 deletions