-
Notifications
You must be signed in to change notification settings - Fork 237
Open
Description
Abstract
Therkyv's lib ArchivedVec::as_slice()method triggers a Stacked Borrows violation when running tests under miri.
Reproduction
Test location:
core/crates/primitives/src/bytes/rkyv.rs
Lines 49 to 59 in 52a263d
| #[test] | |
| fn rkyv_roundtrip() { | |
| let bytes = Bytes::from_static(&[1, 35, 69, 103, 137, 171, 205, 239]); | |
| let ser = rkyv::to_bytes::<rancor::BoxedError>(&bytes).unwrap(); | |
| let archived = rkyv::access::<Archived<Bytes>, rancor::BoxedError>(&ser).unwrap(); | |
| assert_eq!(bytes.as_ref(), archived.as_slice()); | |
| let des = rkyv::deserialize::<Bytes, rancor::BoxedError>(archived).unwrap(); | |
| assert_eq!(bytes, des); | |
| } |
Command:
cargo +nightly miri test --all-features
Error:
error: Undefined Behavior: trying to retag from <...> for SharedReadOnly permission,
but that tag does not exist in the borrow stack for this location
Environment:
- rkyv 0.8.12
- nightly Rust with miri
Fix ?
Is it acceptable to mark rkyv_roundtrip test as #[cfg(not(miri))] ?
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Todo