rust/library/core
Andreas Molzer e44784b875 Assume slice len is bounded by allocation size
Uses assume to check the length against a constant upper bound. The
inlined result then informs the optimizer of the sound value range.

This was tried with unreachable_unchecked before which introduces a
branch. This has the advantage of not being executed in sound code but
complicates basic blocks. It resulted in ~2% increased compile time in
some worst cases.

Add a codegen test for the assumption, testing the issue from #67186
2020-10-04 20:43:36 +02:00
..
benches flt2dec: properly handle uninitialized memory 2020-09-02 12:41:38 +02:00
src Assume slice len is bounded by allocation size 2020-10-04 20:43:36 +02:00
tests Rollup merge of #76454 - poliorcetics:ui-to-unit-test-1, r=matklad 2020-09-28 18:39:39 +02:00
Cargo.toml mv std libs to library/ 2020-07-27 19:51:13 -05:00