-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
This crate does exactly what I'm looking for, but alas...
$ cargo miri test lockmap::testsrunning 10 tests
test lockmap::tests::test_lockmap_get_set ...
error: Undefined Behavior: trying to retag from <298302> for Unique permission at alloc136154[0x0], but that tag does not exist in the borrow stack for this location
--> src/lockmap.rs:524:30
|
524 | let state = unsafe { &mut *ptr };
| ^^^^^^^^^ this error occurs as part of retag at alloc136154[0x0..0x10]
|
= 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: <298302> was created by a SharedReadWrite retag at offsets [0x0..0x10]
--> src/lockmap.rs:126:27
|
126 | let ptr = state.as_mut() as _;
| ^^^^^^^^^^^^^^
help: <298302> was later invalidated at offsets [0x0..0x10] by a Unique retag
--> src/lockmap.rs:127:40
|
127 | (UpdateAction::Replace(state), ptr)
| ^^^^^
= note: BACKTRACE (of the first span) on thread `unnamed-2`:
= note: inside `lockmap::LockMap::<u32, u32>::guard_by_val` at src/lockmap.rs:524:30: 524:39
note: inside `lockmap::LockMap::<u32, u32>::entry`
--> src/lockmap.rs:131:9
|
131 | self.guard_by_val(ptr, key)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside closure
--> src/lockmap.rs:1017:37
|
1017 | let mut entry = lock_map.entry(key);
| ^^^^^^^^^^^^^^^^^^^
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`Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels