Skip to content

Commit 895a8e7

Browse files
committed
Auto merge of rust-lang#81312 - dylni:clarify-btree-range-search-comments, r=m-ou-se
Clarify BTree `range_search` comments These comments were added by rust-lang#81169. However, the soundness issue [might not be exploitable here](rust-lang#81169 (comment)), so the comments should be updated. cc `@ssomers`
2 parents 2aafe45 + 35a2096 commit 895a8e7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: library/alloc/src/collections/btree/search.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,8 @@ impl<BorrowType: marker::BorrowType, K, V> NodeRef<BorrowType, K, V, marker::Lea
9494
K: Borrow<Q>,
9595
R: RangeBounds<Q>,
9696
{
97-
// WARNING: Inlining these variables would be unsound (#81138)
98-
// We assume the bounds reported by `range` remain the same, but
99-
// an adversarial implementation could change between calls
97+
// Inlining these variables should be avoided. We assume the bounds reported by `range`
98+
// remain the same, but an adversarial implementation could change between calls (#81138).
10099
let (start, end) = (range.start_bound(), range.end_bound());
101100
match (start, end) {
102101
(Bound::Excluded(s), Bound::Excluded(e)) if s == e => {

0 commit comments

Comments
 (0)