about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/snippet.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-09-18 05:47:00 +0000
committerbors <bors@rust-lang.org>2020-09-18 05:47:00 +0000
commita0925fba747b4cf910592540aa1f817778dc315c (patch)
tree29639663a51d9a1e6b2f3a1b62f8348ca361477a /compiler/rustc_errors/src/snippet.rs
parentf3c923a13a458c35ee26b3513533fce8a15c9c05 (diff)
parent378b64392f5bdbcffbdc6506b00b6bfcfcd46d73 (diff)
downloadrust-a0925fba747b4cf910592540aa1f817778dc315c.tar.gz
rust-a0925fba747b4cf910592540aa1f817778dc315c.zip
Auto merge of #76790 - ssomers:btree_slice_slasher_returns, r=Mark-Simulacrum
BTreeMap: avoid slices even more

Epilogue to #73971: it seems the compiler is unable to realize that creating a slice and `get_unchecked`-ing one element is a simple fetch. So try to spell it out for the only remaining but often invoked case.

Also, the previous code doesn't seem fair game to me, using `get_unchecked` to reach beyond the end of a slice. Although the local function `slice_insert` also does that.

r? `@Mark-Simulacrum`
Diffstat (limited to 'compiler/rustc_errors/src/snippet.rs')
0 files changed, 0 insertions, 0 deletions