diff --git a/ci/miri.sh b/ci/miri.sh index 2c91474..0ffbe96 100755 --- a/ci/miri.sh +++ b/ci/miri.sh @@ -9,4 +9,4 @@ rustup default "$MIRI_NIGHTLY" rustup component add miri cargo miri setup -cargo miri test --all-features +MIRIFLAGS='-Zmiri-strict-provenance' cargo miri test --all-features diff --git a/src/traits.rs b/src/traits.rs index a136306..4be2d2d 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -94,7 +94,9 @@ pub(crate) mod internal { U: Capacity, { // Convert to `String::into_raw_parts` once stabilized - let mut owned = ManuallyDrop::new(owned); + // We need to go through Vec here to get provenance for the entire allocation + // instead of just the initialized parts. + let mut owned = ManuallyDrop::new(owned.into_bytes()); let (fat, cap) = U::store(owned.len(), owned.capacity()); (