]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #81354 - SkiFire13:binary-search-assume, r=nagisa
authorbors <bors@rust-lang.org>
Sun, 28 Mar 2021 03:51:22 +0000 (03:51 +0000)
committerbors <bors@rust-lang.org>
Sun, 28 Mar 2021 03:51:22 +0000 (03:51 +0000)
commit1df20569dd07d91ed270ea9cfc2dbb9f56700703
tree7bfa02c3ae5addd0148397f4ff82bdab22d91ef1
parent3bfc85149e9620b029fd5c85b02abcbf7ab1a64e
parentc9d04c2b238dc5ab51bd8a92c41ba17bb5b00ed7
Auto merge of #81354 - SkiFire13:binary-search-assume, r=nagisa

Instruct LLVM that binary_search returns a valid index

This allows removing bound checks when the return value of `binary_search` is used to index into the slice it was call on. I also added a codegen test for this, not sure if it's the right thing to do (I didn't find anything on the dev guide), but it felt so.
library/core/src/slice/mod.rs