rust/library/core
bors 4573a4a879 Auto merge of #86383 - shamatar:slice_len_lowering, r=bjorn3
Add MIR pass to lower call to `core::slice::len` into `Len` operand

During some larger experiment with range analysis I've found that code like `let l = slice.len()` produces different MIR then one found in bound checks. This optimization pass replaces terminators that are calls to `core::slice::len` with just a MIR operand and Goto terminator.

It uses some heuristics to remove the outer borrow that is made to call `core::slice::len`, but I assume it can be eliminated, just didn't find how.

Would like to express my gratitude to `@oli-obk` who helped me a lot on Zullip
2021-06-21 22:24:13 +00:00
..
benches move core::hint::black_box under its own feature gate 2021-04-25 11:08:12 +02:00
src Auto merge of #86383 - shamatar:slice_len_lowering, r=bjorn3 2021-06-21 22:24:13 +00:00
tests disable test on platforms that don't support unwinding 2021-06-20 12:20:05 +02:00
Cargo.toml Auto merge of #82271 - Aaron1011:debug-refcell, r=m-ou-se 2021-03-23 04:49:47 +00:00