Commit 63379d6
committed
Auto merge of rust-lang#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.1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2204 | 2204 | | |
2205 | 2205 | | |
2206 | 2206 | | |
| 2207 | + | |
| 2208 | + | |
2207 | 2209 | | |
2208 | 2210 | | |
2209 | 2211 | | |
| |||
0 commit comments