diff options
| author | bors <bors@rust-lang.org> | 2021-03-18 08:18:06 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-03-18 08:18:06 +0000 |
| commit | 895a8e71b1a9fc42631f81b071bc855f7fb3e9a4 (patch) | |
| tree | edd45a4a3b256f3b5f5ca48483c8f91e162e58db | |
| parent | 2aafe452b898aa3fdfb2c5a1a649ed0922e1401d (diff) | |
| parent | 35a2096538cf7cf2b73073a9c078dd7acd578764 (diff) | |
| download | rust-895a8e71b1a9fc42631f81b071bc855f7fb3e9a4.tar.gz rust-895a8e71b1a9fc42631f81b071bc855f7fb3e9a4.zip | |
Auto merge of #81312 - dylni:clarify-btree-range-search-comments, r=m-ou-se
Clarify BTree `range_search` comments These comments were added by #81169. However, the soundness issue [might not be exploitable here](https://github.com/rust-lang/rust/pull/81169#issuecomment-765271717), so the comments should be updated. cc `@ssomers`
| -rw-r--r-- | library/alloc/src/collections/btree/search.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/library/alloc/src/collections/btree/search.rs b/library/alloc/src/collections/btree/search.rs index f376b3cde02..5dc62d4ec70 100644 --- a/library/alloc/src/collections/btree/search.rs +++ b/library/alloc/src/collections/btree/search.rs @@ -94,9 +94,8 @@ impl<BorrowType: marker::BorrowType, K, V> NodeRef<BorrowType, K, V, marker::Lea K: Borrow<Q>, R: RangeBounds<Q>, { - // WARNING: Inlining these variables would be unsound (#81138) - // We assume the bounds reported by `range` remain the same, but - // an adversarial implementation could change between calls + // Inlining these variables should be avoided. We assume the bounds reported by `range` + // remain the same, but an adversarial implementation could change between calls (#81138). let (start, end) = (range.start_bound(), range.end_bound()); match (start, end) { (Bound::Excluded(s), Bound::Excluded(e)) if s == e => { |
