Skip to content

inplace-iter crate #2337

@carols10cents

Description

@carols10cents

The crates.io support email got a report about inplace-iter

so I'm handing this over to you. Please let us know if there's any action you think crates.io should take!

This crate uses unsafe code to directly create undefined behavior

An issue has been created, but there has been no response within two weeks

Looks like the reporter has actually filed 2 issues on inplace-iter's repo:

  1. Miri Undefined Behavior AnickaBurova/inplace-iter#1
  2. Unsoundness warning AnickaBurova/inplace-iter#2
The reporter also included this `miri test --workspace --no-fail-fast` output
   Finished `test` profile [unoptimized + debuginfo] target(s) in 0.03s
    Running unittests src/lib.rs (target/miri/aarch64-unknown-linux-gnu/debug/deps/inplace_iter-64ceffbfcbdc616c)

running 8 tests
test removable_iterator_vec::tests::test_removable_iterator_basic ... error: Undefined Behavior: trying to retag from <280134> for Unique permission at alloc118743[0x0], but that tag does not exist in the borrow stack for this location
  --> src/inplace_vec_iterator.rs:102:21
   |
102 |             let v = &mut (*self.data);
   |                     ^^^^^^^^^^^^^^^^^
   |                     |
   |                     trying to retag from <280134> for Unique permission at alloc118743[0x0], but that tag does not exist in the borrow stack for this location
   |                     this error occurs as part of retag at alloc118743[0x0..0x18]
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
   = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <280134> was created by a SharedReadWrite retag at offsets [0x0..0x18]
  --> src/inplace_vec_iterator.rs:142:20
   |
142 |         let data = v as *mut Vec<T>;
   |                    ^
help: <280134> was later invalidated at offsets [0x0..0x18] by a Unique retag
  --> src/inplace_vec_iterator.rs:144:30
   |
144 |             _lifetime_guard: v,
   |                              ^
   = note: BACKTRACE (of the first span) on thread `removable_itera`:
   = note: inside `<inplace_vec_iterator::InplaceVecIterator<'_, i32> as std::iter::Iterator>::next` at src/inplace_vec_iterator.rs:102:21: 102:38
note: inside `removable_iterator_vec::tests::test_removable_iterator_basic`
  --> src/removable_iterator_vec.rs:10:20
   |
10  |         assert_eq!(iter.next().unwrap().get(), &1);
   |                    ^^^^^^^^^^^
note: inside closure
  --> src/removable_iterator_vec.rs:7:39
   |
6   |     #[test]
   |     ------- in this procedural macro expansion
7   |     fn test_removable_iterator_basic() {
   |                                       ^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error

error: test failed, to rerun pass `--lib`

Caused by:
 process didn't exit successfully: `/home/lrne/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/bin/cargo-miri runner /path/to/inplace-iter/target/miri/aarch64-unknown-linux-gnu/debug/deps/inplace_iter-64ceffbfcbdc616c` (exit status: 1)
note: test exited abnormally; to see the full output pass --nocapture to the harness.
  Doc-tests inplace_iter

running 12 tests
test src/lib.rs - (line 117) ... FAILED
test src/inplace_vector.rs - inplace_vector::InplaceVector (line 19) ... FAILED
test src/lib.rs - (line 77) ... FAILED
test src/lib.rs - (line 30) ... FAILED
test src/lib.rs - (line 43) ... FAILED
test src/inplace_vector.rs - inplace_vector::InplaceVector (line 33) ... FAILED
test src/lib.rs - (line 97) ... FAILED
test src/lib.rs - (line 62) ... FAILED
test src/removable_iterator.rs - removable_iterator::RemovableItem (line 14) ... FAILED
test src/takeable_iterator.rs - takeable_iterator::TakeableItem (line 16) ... FAILED
test src/takeable_iterator.rs - takeable_iterator::TakeableItemMut (line 64) ... FAILED
test src/removable_iterator.rs - removable_iterator::RemovableItemMut (line 62) ... FAILED

failures:

---- src/lib.rs - (line 117) stdout ----
Test executable failed (exit status: 1).

stderr:
error: Undefined Behavior: trying to retag from <1552> for Unique permission at alloc819[0x0], but that tag does not exist in the borrow stack for this location
  --> /path/to/inplace-iter/src/removable_confirm_iterator_vec.rs:90:21
   |
90  |             let v = &mut (*self.data);
   |                     ^^^^^^^^^^^^^^^^^
   |                     |
   |                     trying to retag from <1552> for Unique permission at alloc819[0x0], but that tag does not exist in the borrow stack for this location
   |                     this error occurs as part of retag at alloc819[0x0..0x18]
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
   = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <1552> was created by a SharedReadWrite retag at offsets [0x0..0x18]
  --> /path/to/inplace-iter/src/removable_confirm_iterator_vec.rs:59:20
   |
59  |         let data = v as *mut Vec<T>;
   |                    ^
help: <1552> was later invalidated at offsets [0x0..0x18] by a Unique retag
  --> /path/to/inplace-iter/src/removable_confirm_iterator_vec.rs:62:21
   |
62  |             vector: v,
   |                     ^
   = note: BACKTRACE (of the first span):
   = note: inside `inplace_iter::removable_confirm_iterator_vec::InplaceRemovableConfirmVecIterator::<'_, i32>::next_item::<inplace_iter::removable_confirm_iterator_vec::InplaceRemovableConfirmVecItem<i32>>` at /path/to/inplace-iter/src/removable_confirm_iterator_vec.rs:90:21: 90:38
note: inside `<inplace_iter::removable_confirm_iterator_vec::InplaceRemovableConfirmVecIterator<'_, i32> as std::iter::Iterator>::next`
  --> /path/to/inplace-iter/src/removable_confirm_iterator_vec.rs:130:9
   |
130 |         self.next_item()
   |         ^^^^^^^^^^^^^^^^
   = note: inside `<&mut inplace_iter::removable_confirm_iterator_vec::InplaceRemovableConfirmVecIterator<'_, i32> as std::iter::Iterator>::next` at /home/lrne/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:4049:9: 4049:24
note: inside `main::_doctest_main_src_lib_rs_117_0`
  --> src/lib.rs:123:13
   |
9   | for item in confirm.iter() {
   |             ^^^^^^^^^^^^^^
note: inside `main`
  --> src/lib.rs:132:3
   |
18  | } _doctest_main_src_lib_rs_117_0() }
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error



---- src/inplace_vector.rs - inplace_vector::InplaceVector (line 19) stdout ----
Test executable failed (exit status: 1).

stderr:
error: Undefined Behavior: trying to retag from <1552> for Unique permission at alloc821[0x0], but that tag does not exist in the borrow stack for this location
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21
   |
102 |             let v = &mut (*self.data);
   |                     ^^^^^^^^^^^^^^^^^
   |                     |
   |                     trying to retag from <1552> for Unique permission at alloc821[0x0], but that tag does not exist in the borrow stack for this location
   |                     this error occurs as part of retag at alloc821[0x0..0x18]
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
   = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <1552> was created by a SharedReadWrite retag at offsets [0x0..0x18]
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:142:20
   |
142 |         let data = v as *mut Vec<T>;
   |                    ^
help: <1552> was later invalidated at offsets [0x0..0x18] by a Unique retag
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:144:30
   |
144 |             _lifetime_guard: v,
   |                              ^
   = note: BACKTRACE (of the first span):
   = note: inside `<inplace_iter::inplace_vec_iterator::InplaceVecIterator<'_, i32> as std::iter::Iterator>::next` at /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21: 102:38
note: inside `main::_doctest_main_src_inplace_vector_rs_19_0`
  --> src/inplace_vector.rs:24:13
   |
8   | for item in numbers.removable_iter() {
   |             ^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `main`
  --> src/inplace_vector.rs:30:3
   |
14  | } _doctest_main_src_inplace_vector_rs_19_0() }
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error



---- src/lib.rs - (line 77) stdout ----
Test executable failed (exit status: 1).

stderr:
error: Undefined Behavior: trying to retag from <1552> for Unique permission at alloc823[0x0], but that tag does not exist in the borrow stack for this location
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21
   |
102 |             let v = &mut (*self.data);
   |                     ^^^^^^^^^^^^^^^^^
   |                     |
   |                     trying to retag from <1552> for Unique permission at alloc823[0x0], but that tag does not exist in the borrow stack for this location
   |                     this error occurs as part of retag at alloc823[0x0..0x18]
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
   = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <1552> was created by a SharedReadWrite retag at offsets [0x0..0x18]
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:142:20
   |
142 |         let data = v as *mut Vec<T>;
   |                    ^
help: <1552> was later invalidated at offsets [0x0..0x18] by a Unique retag
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:144:30
   |
144 |             _lifetime_guard: v,
   |                              ^
   = note: BACKTRACE (of the first span):
   = note: inside `<inplace_iter::inplace_vec_iterator::InplaceVecIterator<'_, i32> as std::iter::Iterator>::next` at /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21: 102:38
note: inside `main::_doctest_main_src_lib_rs_77_0`
  --> src/lib.rs:83:17
   |
9   | for mut item in numbers.takeable_iter_mut() {
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `main`
  --> src/lib.rs:95:3
   |
21  | } _doctest_main_src_lib_rs_77_0() }
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error



---- src/lib.rs - (line 30) stdout ----
Test executable failed (exit status: 1).

stderr:
error: Undefined Behavior: trying to retag from <1552> for Unique permission at alloc819[0x0], but that tag does not exist in the borrow stack for this location
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21
   |
102 |             let v = &mut (*self.data);
   |                     ^^^^^^^^^^^^^^^^^
   |                     |
   |                     trying to retag from <1552> for Unique permission at alloc819[0x0], but that tag does not exist in the borrow stack for this location
   |                     this error occurs as part of retag at alloc819[0x0..0x18]
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
   = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <1552> was created by a SharedReadWrite retag at offsets [0x0..0x18]
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:142:20
   |
142 |         let data = v as *mut Vec<T>;
   |                    ^
help: <1552> was later invalidated at offsets [0x0..0x18] by a Unique retag
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:144:30
   |
144 |             _lifetime_guard: v,
   |                              ^
   = note: BACKTRACE (of the first span):
   = note: inside `<inplace_iter::inplace_vec_iterator::InplaceVecIterator<'_, i32> as std::iter::Iterator>::next` at /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21: 102:38
note: inside `main::_doctest_main_src_lib_rs_30_0`
  --> src/lib.rs:35:13
   |
8   | for item in numbers.removable_iter() {
   |             ^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `main`
  --> src/lib.rs:41:3
   |
14  | } _doctest_main_src_lib_rs_30_0() }
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error



---- src/lib.rs - (line 43) stdout ----
Test executable failed (exit status: 1).

stderr:
error: Undefined Behavior: trying to retag from <1552> for Unique permission at alloc821[0x0], but that tag does not exist in the borrow stack for this location
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21
   |
102 |             let v = &mut (*self.data);
   |                     ^^^^^^^^^^^^^^^^^
   |                     |
   |                     trying to retag from <1552> for Unique permission at alloc821[0x0], but that tag does not exist in the borrow stack for this location
   |                     this error occurs as part of retag at alloc821[0x0..0x18]
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
   = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <1552> was created by a SharedReadWrite retag at offsets [0x0..0x18]
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:142:20
   |
142 |         let data = v as *mut Vec<T>;
   |                    ^
help: <1552> was later invalidated at offsets [0x0..0x18] by a Unique retag
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:144:30
   |
144 |             _lifetime_guard: v,
   |                              ^
   = note: BACKTRACE (of the first span):
   = note: inside `<inplace_iter::inplace_vec_iterator::InplaceVecIterator<'_, i32> as std::iter::Iterator>::next` at /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21: 102:38
note: inside `main::_doctest_main_src_lib_rs_43_0`
  --> src/lib.rs:48:17
   |
8   | for mut item in numbers.removable_iter_mut() {
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `main`
  --> src/lib.rs:60:3
   |
20  | } _doctest_main_src_lib_rs_43_0() }
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error



---- src/inplace_vector.rs - inplace_vector::InplaceVector (line 33) stdout ----
Test executable failed (exit status: 1).

stderr:
error: Undefined Behavior: trying to retag from <2957> for Unique permission at alloc1534[0x0], but that tag does not exist in the borrow stack for this location
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21
   |
102 |             let v = &mut (*self.data);
   |                     ^^^^^^^^^^^^^^^^^
   |                     |
   |                     trying to retag from <2957> for Unique permission at alloc1534[0x0], but that tag does not exist in the borrow stack for this location
   |                     this error occurs as part of retag at alloc1534[0x0..0x18]
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
   = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <2957> was created by a SharedReadWrite retag at offsets [0x0..0x18]
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:142:20
   |
142 |         let data = v as *mut Vec<T>;
   |                    ^
help: <2957> was later invalidated at offsets [0x0..0x18] by a Unique retag
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:144:30
   |
144 |             _lifetime_guard: v,
   |                              ^
   = note: BACKTRACE (of the first span):
   = note: inside `<inplace_iter::inplace_vec_iterator::InplaceVecIterator<'_, std::string::String> as std::iter::Iterator>::next` at /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21: 102:38
note: inside `main::_doctest_main_src_inplace_vector_rs_33_0`
  --> src/inplace_vector.rs:40:13
   |
10  | for item in names.takeable_iter() {
   |             ^^^^^^^^^^^^^^^^^^^^^
note: inside `main`
  --> src/inplace_vector.rs:49:3
   |
19  | } _doctest_main_src_inplace_vector_rs_33_0() }
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error



---- src/lib.rs - (line 97) stdout ----
Test executable failed (exit status: 1).

stderr:
error: Undefined Behavior: trying to retag from <1552> for Unique permission at alloc819[0x0], but that tag does not exist in the borrow stack for this location
  --> /path/to/inplace-iter/src/removable_confirm_iterator_vec.rs:90:21
   |
90  |             let v = &mut (*self.data);
   |                     ^^^^^^^^^^^^^^^^^
   |                     |
   |                     trying to retag from <1552> for Unique permission at alloc819[0x0], but that tag does not exist in the borrow stack for this location
   |                     this error occurs as part of retag at alloc819[0x0..0x18]
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
   = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <1552> was created by a SharedReadWrite retag at offsets [0x0..0x18]
  --> /path/to/inplace-iter/src/removable_confirm_iterator_vec.rs:59:20
   |
59  |         let data = v as *mut Vec<T>;
   |                    ^
help: <1552> was later invalidated at offsets [0x0..0x18] by a Unique retag
  --> /path/to/inplace-iter/src/removable_confirm_iterator_vec.rs:62:21
   |
62  |             vector: v,
   |                     ^
   = note: BACKTRACE (of the first span):
   = note: inside `inplace_iter::removable_confirm_iterator_vec::InplaceRemovableConfirmVecIterator::<'_, i32>::next_item::<inplace_iter::removable_confirm_iterator_vec::InplaceRemovableConfirmVecItem<i32>>` at /path/to/inplace-iter/src/removable_confirm_iterator_vec.rs:90:21: 90:38
note: inside `<inplace_iter::removable_confirm_iterator_vec::InplaceRemovableConfirmVecIterator<'_, i32> as std::iter::Iterator>::next`
  --> /path/to/inplace-iter/src/removable_confirm_iterator_vec.rs:130:9
   |
130 |         self.next_item()
   |         ^^^^^^^^^^^^^^^^
   = note: inside `<&mut inplace_iter::removable_confirm_iterator_vec::InplaceRemovableConfirmVecIterator<'_, i32> as std::iter::Iterator>::next` at /home/lrne/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:4049:9: 4049:24
note: inside `main::_doctest_main_src_lib_rs_97_0`
  --> src/lib.rs:103:13
   |
9   | for item in confirm.iter() {
   |             ^^^^^^^^^^^^^^
note: inside `main`
  --> src/lib.rs:115:3
   |
21  | } _doctest_main_src_lib_rs_97_0() }
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error



---- src/lib.rs - (line 62) stdout ----
Test executable failed (exit status: 1).

stderr:
error: Undefined Behavior: trying to retag from <1552> for Unique permission at alloc823[0x0], but that tag does not exist in the borrow stack for this location
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21
   |
102 |             let v = &mut (*self.data);
   |                     ^^^^^^^^^^^^^^^^^
   |                     |
   |                     trying to retag from <1552> for Unique permission at alloc823[0x0], but that tag does not exist in the borrow stack for this location
   |                     this error occurs as part of retag at alloc823[0x0..0x18]
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
   = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <1552> was created by a SharedReadWrite retag at offsets [0x0..0x18]
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:142:20
   |
142 |         let data = v as *mut Vec<T>;
   |                    ^
help: <1552> was later invalidated at offsets [0x0..0x18] by a Unique retag
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:144:30
   |
144 |             _lifetime_guard: v,
   |                              ^
   = note: BACKTRACE (of the first span):
   = note: inside `<inplace_iter::inplace_vec_iterator::InplaceVecIterator<'_, i32> as std::iter::Iterator>::next` at /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21: 102:38
note: inside `main::_doctest_main_src_lib_rs_62_0`
  --> src/lib.rs:68:13
   |
9   | for item in numbers.takeable_iter() {
   |             ^^^^^^^^^^^^^^^^^^^^^^^
note: inside `main`
  --> src/lib.rs:75:3
   |
16  | } _doctest_main_src_lib_rs_62_0() }
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error



---- src/removable_iterator.rs - removable_iterator::RemovableItem (line 14) stdout ----
Test executable failed (exit status: 1).

stderr:
error: Undefined Behavior: trying to retag from <1552> for Unique permission at alloc821[0x0], but that tag does not exist in the borrow stack for this location
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21
   |
102 |             let v = &mut (*self.data);
   |                     ^^^^^^^^^^^^^^^^^
   |                     |
   |                     trying to retag from <1552> for Unique permission at alloc821[0x0], but that tag does not exist in the borrow stack for this location
   |                     this error occurs as part of retag at alloc821[0x0..0x18]
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
   = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <1552> was created by a SharedReadWrite retag at offsets [0x0..0x18]
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:142:20
   |
142 |         let data = v as *mut Vec<T>;
   |                    ^
help: <1552> was later invalidated at offsets [0x0..0x18] by a Unique retag
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:144:30
   |
144 |             _lifetime_guard: v,
   |                              ^
   = note: BACKTRACE (of the first span):
   = note: inside `<inplace_iter::inplace_vec_iterator::InplaceVecIterator<'_, i32> as std::iter::Iterator>::next` at /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21: 102:38
note: inside `main::_doctest_main_src_removable_iterator_rs_14_0`
  --> src/removable_iterator.rs:19:13
   |
8   | for item in numbers.removable_iter() {
   |             ^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `main`
  --> src/removable_iterator.rs:27:3
   |
16  | } _doctest_main_src_removable_iterator_rs_14_0() }
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error



---- src/takeable_iterator.rs - takeable_iterator::TakeableItem (line 16) stdout ----
Test executable failed (exit status: 1).

stderr:
error: Undefined Behavior: trying to retag from <1552> for Unique permission at alloc823[0x0], but that tag does not exist in the borrow stack for this location
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21
   |
102 |             let v = &mut (*self.data);
   |                     ^^^^^^^^^^^^^^^^^
   |                     |
   |                     trying to retag from <1552> for Unique permission at alloc823[0x0], but that tag does not exist in the borrow stack for this location
   |                     this error occurs as part of retag at alloc823[0x0..0x18]
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
   = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <1552> was created by a SharedReadWrite retag at offsets [0x0..0x18]
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:142:20
   |
142 |         let data = v as *mut Vec<T>;
   |                    ^
help: <1552> was later invalidated at offsets [0x0..0x18] by a Unique retag
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:144:30
   |
144 |             _lifetime_guard: v,
   |                              ^
   = note: BACKTRACE (of the first span):
   = note: inside `<inplace_iter::inplace_vec_iterator::InplaceVecIterator<'_, i32> as std::iter::Iterator>::next` at /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21: 102:38
note: inside `main::_doctest_main_src_takeable_iterator_rs_16_0`
  --> src/takeable_iterator.rs:22:13
   |
9   | for item in numbers.takeable_iter() {
   |             ^^^^^^^^^^^^^^^^^^^^^^^
note: inside `main`
  --> src/takeable_iterator.rs:30:3
   |
17  | } _doctest_main_src_takeable_iterator_rs_16_0() }
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error



---- src/takeable_iterator.rs - takeable_iterator::TakeableItemMut (line 64) stdout ----
Test executable failed (exit status: 1).

stderr:
error: Undefined Behavior: trying to retag from <1552> for Unique permission at alloc823[0x0], but that tag does not exist in the borrow stack for this location
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21
   |
102 |             let v = &mut (*self.data);
   |                     ^^^^^^^^^^^^^^^^^
   |                     |
   |                     trying to retag from <1552> for Unique permission at alloc823[0x0], but that tag does not exist in the borrow stack for this location
   |                     this error occurs as part of retag at alloc823[0x0..0x18]
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
   = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <1552> was created by a SharedReadWrite retag at offsets [0x0..0x18]
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:142:20
   |
142 |         let data = v as *mut Vec<T>;
   |                    ^
help: <1552> was later invalidated at offsets [0x0..0x18] by a Unique retag
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:144:30
   |
144 |             _lifetime_guard: v,
   |                              ^
   = note: BACKTRACE (of the first span):
   = note: inside `<inplace_iter::inplace_vec_iterator::InplaceVecIterator<'_, i32> as std::iter::Iterator>::next` at /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21: 102:38
note: inside `main::_doctest_main_src_takeable_iterator_rs_64_0`
  --> src/takeable_iterator.rs:70:17
   |
9   | for mut item in numbers.takeable_iter_mut() {
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `main`
  --> src/takeable_iterator.rs:82:3
   |
21  | } _doctest_main_src_takeable_iterator_rs_64_0() }
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error



---- src/removable_iterator.rs - removable_iterator::RemovableItemMut (line 62) stdout ----
Test executable failed (exit status: 1).

stderr:
error: Undefined Behavior: trying to retag from <1552> for Unique permission at alloc821[0x0], but that tag does not exist in the borrow stack for this location
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21
   |
102 |             let v = &mut (*self.data);
   |                     ^^^^^^^^^^^^^^^^^
   |                     |
   |                     trying to retag from <1552> for Unique permission at alloc821[0x0], but that tag does not exist in the borrow stack for this location
   |                     this error occurs as part of retag at alloc821[0x0..0x18]
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
   = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <1552> was created by a SharedReadWrite retag at offsets [0x0..0x18]
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:142:20
   |
142 |         let data = v as *mut Vec<T>;
   |                    ^
help: <1552> was later invalidated at offsets [0x0..0x18] by a Unique retag
  --> /path/to/inplace-iter/src/inplace_vec_iterator.rs:144:30
   |
144 |             _lifetime_guard: v,
   |                              ^
   = note: BACKTRACE (of the first span):
   = note: inside `<inplace_iter::inplace_vec_iterator::InplaceVecIterator<'_, i32> as std::iter::Iterator>::next` at /path/to/inplace-iter/src/inplace_vec_iterator.rs:102:21: 102:38
note: inside `main::_doctest_main_src_removable_iterator_rs_62_0`
  --> src/removable_iterator.rs:67:17
   |
8   | for mut item in numbers.removable_iter_mut() {
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `main`
  --> src/removable_iterator.rs:79:3
   |
20  | } _doctest_main_src_removable_iterator_rs_62_0() }
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error




failures:
   src/inplace_vector.rs - inplace_vector::InplaceVector (line 19)
   src/inplace_vector.rs - inplace_vector::InplaceVector (line 33)
   src/lib.rs - (line 117)
   src/lib.rs - (line 30)
   src/lib.rs - (line 43)
   src/lib.rs - (line 62)
   src/lib.rs - (line 77)
   src/lib.rs - (line 97)
   src/removable_iterator.rs - removable_iterator::RemovableItem (line 14)
   src/removable_iterator.rs - removable_iterator::RemovableItemMut (line 62)
   src/takeable_iterator.rs - takeable_iterator::TakeableItem (line 16)
   src/takeable_iterator.rs - takeable_iterator::TakeableItemMut (line 64)

test result: FAILED. 0 passed; 12 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.74s

error: doctest failed, to rerun pass `--doc`
error: 2 targets failed:
   `--lib`
   `--doc`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions