Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6dfcf9a
Remove branches from sift_down_to_bottom loop
SkiFire13 Nov 7, 2020
25b3f61
Remove useless branches from sift_down_range loop
SkiFire13 Nov 7, 2020
8d15753
Remove useless bound checks from into_sorted_vec
SkiFire13 Nov 7, 2020
387568c
Added SAFETY comment as request
SkiFire13 Nov 9, 2020
de84ad9
Implement destructuring assignment for structs and slices
fanzier Nov 7, 2020
f344134
Add asm register information for SPIR-V
khyperia Nov 11, 2020
0e34b73
Change capitalization of Spirv to SpirV
khyperia Nov 11, 2020
40d34b2
Never inline when `no_sanitize` attributes differ
tmiasko Nov 11, 2020
cd7b2d3
Never inline cold functions
tmiasko Nov 11, 2020
4d6afcb
Remove check for impossible condition
tmiasko Nov 11, 2020
f5fca8b
Fix generator inlining by checking for rust-call abi and spread arg
tmiasko Nov 11, 2020
b56e421
Never inline C variadic functions
tmiasko Nov 11, 2020
f91a0ef
./x.py test --bless
tmiasko Nov 11, 2020
cd314ae
update rustfmt
calebcartwright Nov 12, 2020
c338c81
Update cargo
ehuss Nov 12, 2020
80b2835
extend min_const_generics param ty tests
lcnr Nov 12, 2020
68d8d4b
Rollup merge of #78836 - fanzier:struct-and-slice-destructuring, r=pe…
m-ou-se Nov 12, 2020
1b9ba6b
Rollup merge of #78857 - SkiFire13:bheap-opt, r=KodrAus
m-ou-se Nov 12, 2020
a3b0c14
Rollup merge of #78950 - khyperia:spirv-asm, r=Amanieu
m-ou-se Nov 12, 2020
d3a7a5d
Rollup merge of #78966 - tmiasko:inline-never, r=oli-obk
m-ou-se Nov 12, 2020
42a6a43
Rollup merge of #78970 - calebcartwright:update-rustfmt, r=Aaron1011
m-ou-se Nov 12, 2020
50c1b1e
Rollup merge of #78972 - ehuss:update-cargo, r=ehuss
m-ou-se Nov 12, 2020
3cc4599
Rollup merge of #78987 - lcnr:integer-sizes, r=varkor
m-ou-se Nov 12, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added SAFETY comment as request
  • Loading branch information
SkiFire13 committed Nov 9, 2020
commit 387568cd564317ca7491e6960ddcbe13beecae13
4 changes: 4 additions & 0 deletions library/alloc/src/collections/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,10 @@ impl<T: Ord> BinaryHeap<T> {
let mut end = self.len();
while end > 1 {
end -= 1;
// SAFETY: `end` goes from `self.len() - 1` to 1 (both included),
// so it's always a valid index to access.
// It is safe to access index 0 (i.e. `ptr`), because
// 1 <= end < self.len(), which means self.len() >= 2.
unsafe {
let ptr = self.data.as_mut_ptr();
ptr::swap(ptr, ptr.add(end));
Expand Down