diff options
| author | bors <bors@rust-lang.org> | 2023-05-18 02:09:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-18 02:09:55 +0000 |
| commit | 72a1796615a26b373c459ebfa79484987d53f1d8 (patch) | |
| tree | 17c1c8521a250a556ff26146b438a692ca142781 /tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-abort.diff | |
| parent | d0768aad62e13ec63cba9d857c8b3fe7657dfb33 (diff) | |
| parent | 77be56b691c9a2d9739d9b4e360cae148b0e0972 (diff) | |
| download | rust-72a1796615a26b373c459ebfa79484987d53f1d8.tar.gz rust-72a1796615a26b373c459ebfa79484987d53f1d8.zip | |
Auto merge of #14819 - weihanglo:divided-by-zero, r=lnicola
fix(analysis-stats): divided by zero error ## What does this PR try to resolve? 2023-05-15 rust-analyzer suffers from ``` thread 'main' panicked at 'attempt to divide by zero', crates/rust-analyzer/src/cli/analysis_stats.rs:230:56 ``` This commit <https://github.com/rust-lang/rust-analyzer/pull/14808/commits/51e8b8ff14de3507d5e21d80b750577da52b6fdd> might be the culprit. This PR uses `percentage` function to avoid the classic “division by zero” bug. ## Reproducer ```console cargo new ra-test pushd ra-test echo "pub type Foo = u32;" >> src/lib.rs rust-analyzer analysis-stats . ```
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-abort.diff')
0 files changed, 0 insertions, 0 deletions
