about summary refs log tree commit diff
path: root/src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2019-09-21 18:39:35 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2019-09-29 17:52:20 -0400
commit06c6e75aae8918f2d7e5ab7089b36c7ac9ec73bb (patch)
tree617a0b4e24695f73b82319c29b7d04478271d6a8 /src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs
parent06c68947ad88f22a8342fe6b54dc0fe54de6e011 (diff)
downloadrust-06c6e75aae8918f2d7e5ab7089b36c7ac9ec73bb.tar.gz
rust-06c6e75aae8918f2d7e5ab7089b36c7ac9ec73bb.zip
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