]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #106950 - the8472:fix-splice-miri, r=cuviper
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>
Wed, 18 Jan 2023 10:25:38 +0000 (15:55 +0530)
committerGitHub <noreply@github.com>
Wed, 18 Jan 2023 10:25:38 +0000 (15:55 +0530)
Don't do pointer arithmetic on pointers to deallocated memory

vec::Splice can invalidate the slice::Iter inside vec::Drain. So we replace them with dangling pointers which, unlike ones to deallocated memory, are allowed.

Fixes miri test failures.
Fixes https://github.com/rust-lang/miri/issues/2759


Trivial merge