Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,15 @@ jobs:
# Run under both the stacked borrows model (default) and under the tree
# borrows model to ensure we're compliant with both.
for EXTRA_FLAGS in "" "-Zmiri-tree-borrows"; do
MIRIFLAGS="$MIRIFLAGS $EXTRA_FLAGS" ./cargo.sh +$TOOLCHAIN \
miri nextest run \
--test-threads "$THREADS" \
--package $CRATE \
--target $TARGET \
$FEATURES
# Run with and without unstable rust features.
for EXTRA_CFG_FLAGS in "" "--cfg __ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS"; do
MIRIFLAGS="$MIRIFLAGS $EXTRA_FLAGS $EXTRA_CFG_FLAGS" ./cargo.sh +$TOOLCHAIN \
miri nextest run \
--test-threads "$THREADS" \
--package $CRATE \
--target $TARGET \
$FEATURES
done
done

mv .cargo/config.toml.bak .cargo/config.toml
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[package]
edition = "2021"
name = "zerocopy"
version = "0.8.48"
version = "0.8.49"
authors = [
"Joshua Liebow-Feeser <joshlf@google.com>",
"Jack Wrenn <jswrenn@amazon.com>",
Expand Down Expand Up @@ -124,13 +124,13 @@ __internal_use_only_features_that_work_on_stable = [
]

[dependencies]
zerocopy-derive = { version = "=0.8.48", path = "zerocopy-derive", optional = true }
zerocopy-derive = { version = "=0.8.49", path = "zerocopy-derive", optional = true }

# The "associated proc macro pattern" ensures that the versions of zerocopy and
# zerocopy-derive remain equal, even if the 'derive' feature isn't used.
# See: https://github.com/matklad/macro-dep-test
[target.'cfg(any())'.dependencies]
zerocopy-derive = { version = "=0.8.48", path = "zerocopy-derive" }
zerocopy-derive = { version = "=0.8.49", path = "zerocopy-derive" }

[dev-dependencies]
# FIXME(#381) Remove this dependency once we have our own layout gadgets.
Expand All @@ -142,4 +142,4 @@ rustversion = "1.0"
static_assertions = "1.1"
testutil = { path = "testutil" }
# In tests, unlike in production, zerocopy-derive is not optional
zerocopy-derive = { version = "=0.8.48", path = "zerocopy-derive" }
zerocopy-derive = { version = "=0.8.49", path = "zerocopy-derive" }
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,7 @@
#![cfg_attr(feature = "float-nightly", feature(f16, f128))]
#![cfg_attr(doc_cfg, feature(doc_cfg))]
#![cfg_attr(__ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS, feature(coverage_attribute))]
#![cfg_attr(
any(__ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS, miri),
feature(layout_for_ptr)
)]
#![cfg_attr(__ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS, feature(layout_for_ptr))]
#![cfg_attr(all(test, __ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS), feature(test))]

// This is a hack to allow zerocopy-derive derives to work in this crate. They
Expand Down
4 changes: 2 additions & 2 deletions src/pointer/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ mod _conversions {
let raw = self.as_inner().as_non_null();
// SAFETY: `self` satisfies the `Aligned` invariant, so we know that
// `raw` is validly-aligned for `T`.
#[cfg(miri)]
#[cfg(all(__ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS, miri))]
unsafe {
crate::util::miri_promise_symbolic_alignment(
raw.as_ptr().cast(),
Expand Down Expand Up @@ -381,7 +381,7 @@ mod _conversions {
let mut raw = self.as_inner().as_non_null();
// SAFETY: `self` satisfies the `Aligned` invariant, so we know that
// `raw` is validly-aligned for `T`.
#[cfg(miri)]
#[cfg(all(__ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS, miri))]
unsafe {
crate::util::miri_promise_symbolic_alignment(
raw.as_ptr().cast(),
Expand Down
2 changes: 1 addition & 1 deletion src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl<T: ?Sized> Clone for SendSyncPhantomData<T> {
}
}

#[cfg(miri)]
#[cfg(all(__ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS, miri))]
extern "Rust" {
/// Miri-provided intrinsic that marks the pointer `ptr` as aligned to
/// `align`.
Expand Down
2 changes: 1 addition & 1 deletion zerocopy-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[package]
edition = "2021"
name = "zerocopy-derive"
version = "0.8.48"
version = "0.8.49"
authors = ["Joshua Liebow-Feeser <joshlf@google.com>", "Jack Wrenn <jswrenn@amazon.com>"]
description = "Custom derive for traits from the zerocopy crate"
license = "BSD-2-Clause OR Apache-2.0 OR MIT"
Expand Down
Loading