about summary refs log tree commit diff
path: root/src/test/rustdoc-ui/coverage/json.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-08-15 13:41:05 +0000
committerbors <bors@rust-lang.org>2020-08-15 13:41:05 +0000
commitb9db927b68f4b2e9c3e648be35b412ac1839ec54 (patch)
treeb24c1420b4906c19a153d85e436029d31478ace5 /src/test/rustdoc-ui/coverage/json.rs
parent80fb3f3139c7dee7f211964c6a0b3ccb04b83d5e (diff)
parentaf9b9e4ec874c4bc5c771841d491e02d02d5636a (diff)
downloadrust-b9db927b68f4b2e9c3e648be35b412ac1839ec54.tar.gz
rust-b9db927b68f4b2e9c3e648be35b412ac1839ec54.zip
Auto merge of #75537 - tmiasko:match-branch-simplify, r=oli-obk
MatchBranchSimplification: fix equal const bool assignments

The match branch simplification is applied when target blocks contain
statements that are either equal or perform a const bool assignment with
different values to the same place.

Previously, when constructing new statements, only statements from a
single block had been examined. This lead to a misoptimization when
statements are equal because the assign the *same* const bool value to
the same place.

Fix the issue by examining statements from both blocks when deciding on
replacement.

Additionally:

* Copy discriminant instead of moving it since it might be necessary to use its
  value more than once.
* Optimize when switching on copy operand

Based on #75508.

r? @oli-obk  / @JulianKnodt
Diffstat (limited to 'src/test/rustdoc-ui/coverage/json.rs')
0 files changed, 0 insertions, 0 deletions