rust/src/test
bors beb5ae474d Auto merge of #77023 - HeroicKatora:len-missed-optimization, r=Mark-Simulacrum
Hint the maximum length permitted by invariant of slices

One of the safety invariants of references, and in particular of references to slices, is that they may not cover more than `isize::MAX` bytes. The unsafe `from_raw_parts` constructors of slices explicitly requires the caller to guarantee this fact. Violating it would also be UB with regards to the semantics of generated llvm code.

This effectively bounds the length of a (non-ZST) slice from above by a compile time constant. But when the length is loaded from a function argument it appears llvm is not aware of this requirement. The additional value range assertions allow some further elision of code branches, including overflow checks, especially in the presence of artithmetic on the indices.

This may have a performance impact, adding more code to a common method but allowing more optimization. I'm not quite sure, is the Rust side of const-prop strong enough to elide the irrelevant match branches?

Fixes: #67186
2020-10-04 21:08:06 +00:00
..
assembly Auto merge of #77008 - fortanix:raoul/lvi-tests, r=Mark-Simulacrum 2020-09-28 03:28:04 +00:00
auxiliary
codegen Auto merge of #77023 - HeroicKatora:len-missed-optimization, r=Mark-Simulacrum 2020-10-04 21:08:06 +00:00
codegen-units Move from {{closure}}#0 syntax to {closure#0} for (def) path components 2020-09-25 22:46:14 +01:00
compile-fail Update compile-fail test 2020-09-29 19:45:06 -07:00
debuginfo debuginfo: Ignore HashMap tests before cdb 10.0.18362.1 2020-09-05 14:47:16 -07:00
incremental Update incremental tests 2020-09-19 10:36:37 +02:00
mir-opt Ignore now-broken mir-opt test 2020-10-02 16:50:45 +02:00
pretty pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
run-make cleaning up code 2020-09-25 15:13:55 +02:00
run-make-fulldeps Auto merge of #76754 - varkor:diagnostic-cleanup-ii, r=ecstatic-morse 2020-09-29 14:28:58 +00:00
run-pass-valgrind
rustdoc Auto merge of #77253 - jyn514:crate-link, r=Manishearth 2020-09-29 12:11:17 +00:00
rustdoc-js Allow #[doc(alias)] on impl const items 2020-08-12 11:09:24 +02:00
rustdoc-js-std
rustdoc-ui Rollup merge of #77469 - camelid:rustdoc-better-failed-res-error, r=jyn514 2020-10-04 11:45:08 +09:00
rustfix
ui Rollup merge of #77504 - Amanieu:select_simd_bitmask, r=ecstatic-morse 2020-10-04 15:45:43 +02:00
ui-fulldeps Rollup merge of #76474 - bjorn3:driver_selected_codegen, r=oli-obk 2020-09-28 18:39:40 +02:00
COMPILER_TESTS.md