about summary refs log tree commit diff
path: root/src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-09-29 22:21:43 +0000
committerbors <bors@rust-lang.org>2019-09-29 22:21:43 +0000
commitd16ee891c63e2441ba97072a83fa79b0b6e6e01a (patch)
tree56a95eb33cd2418cbc852bd915a7dfdb6993bcce /src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs
parent8431f261dd160021b6af85916f161a13dd101ca0 (diff)
parent06c6e75aae8918f2d7e5ab7089b36c7ac9ec73bb (diff)
downloadrust-d16ee891c63e2441ba97072a83fa79b0b6e6e01a.tar.gz
rust-d16ee891c63e2441ba97072a83fa79b0b6e6e01a.zip
Auto merge of #64673 - Mark-Simulacrum:opt-match-ck, r=oli-obk
Optimize try_eval_bits to avoid layout queries

This specifically targets match checking, but is possibly more widely
useful as well. In code with large, single-value match statements, we
were previously spending a lot of time running layout_of for the
primitive types (integers, chars) -- which is essentially useless. This
optimizes the code to avoid those query calls by directly obtaining the
size for these types, when possible.

It may be worth considering adding a `size_of` query in the future which
might be far faster, especially if specialized for "const" cases --
match arms being the most obvious example. It's possibly such a function
would benefit from *not* being a query as well, since it's trivially
evaluatable from the sty for many cases whereas a query needs to hash
the input and such.
Diffstat (limited to 'src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs')
0 files changed, 0 insertions, 0 deletions