Fix possible soundness issue in ensure_subset_of
This commit is contained in:
parent
9d29793614
commit
cb647f3e8e
8 changed files with 112 additions and 110 deletions
|
@ -1650,7 +1650,7 @@ impl<T, A: Allocator> Vec<T, A> {
|
|||
// the hole, and the vector length is restored to the new length.
|
||||
//
|
||||
let len = self.len();
|
||||
let Range { start, end } = range.ensure_subset_of(..len);
|
||||
let Range { start, end } = Range::ensure_subset_of(range, ..len);
|
||||
|
||||
unsafe {
|
||||
// set self.vec length's to start, to be safe in case Drain is leaked
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue