diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd06bf2c0c..af0c64c548 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -276,6 +276,15 @@ jobs: name: 'Run tests under Kani' steps: - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - run: | + # If Kani transitively depends on zerocopy, then we'll have zerocopy + # instances in our build graph - the one from crates.io, and the local + # one. This ensures that we always resolve unambiguously to the local + # one. + cargo generate-lockfile + ZC_ZEROCOPY_PKGID="$(cargo pkgid -p path+file:///home/runner/work/zerocopy/zerocopy)" + echo "Found that zerocopy's pkgid is $ZC_ZEROCOPY_PKGID" | tee -a $GITHUB_STEP_SUMMARY + echo "ZC_ZEROCOPY_PKGID=$ZC_ZEROCOPY_PKGID" >> $GITHUB_ENV - uses: model-checking/kani-github-action@f838096619a707b0f6b2118cf435eaccfa33e51f # v1.1 with: # Use `--features __internal_use_only_features_that_work_on_stable` @@ -288,7 +297,7 @@ jobs: # TODO(https://github.com/model-checking/kani-github-action/issues/56): # Go back to testing all features once the Kani GitHub Action supports # specifying a particular toolchain. - args: "--package zerocopy --features __internal_use_only_features_that_work_on_stable --output-format=terse --randomize-layout --memory-safety-checks --overflow-checks --undefined-function-checks --unwinding-checks" + args: "--features __internal_use_only_features_that_work_on_stable --output-format=terse --randomize-layout --memory-safety-checks --overflow-checks --undefined-function-checks --unwinding-checks" # This version is automatically rolled by # `roll-pinned-toolchain-versions.yml`. kani-version: 0.53.0 diff --git a/Cargo.toml b/Cargo.toml index cbfee8e5cd..11599f9046 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,8 +32,8 @@ rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition"] [package.metadata.ci] # The versions of the stable and nightly compiler toolchains to use in CI. -pinned-stable = "1.80.0" -pinned-nightly = "nightly-2024-07-28" +pinned-stable = "1.81.0" +pinned-nightly = "nightly-2024-09-06" [package.metadata.playground] features = ["__internal_use_only_features_that_work_on_stable"] diff --git a/tests/ui-nightly/transmute-mut-const.stderr b/tests/ui-nightly/transmute-mut-const.stderr index 07c4c82ef2..7b611de364 100644 --- a/tests/ui-nightly/transmute-mut-const.stderr +++ b/tests/ui-nightly/transmute-mut-const.stderr @@ -21,7 +21,7 @@ error[E0658]: mutable references are not allowed in constants | = note: see issue #57349 for more information = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - = note: this compiler was built on 2024-07-27; consider upgrading it if it is out of date + = note: this compiler was built on 2024-09-05; consider upgrading it if it is out of date error[E0015]: cannot call non-const fn `transmute_mut::<'_, '_, [u8; 2], [u8; 2]>` in constants --> tests/ui-nightly/transmute-mut-const.rs:20:37 diff --git a/tests/ui-nightly/transmute-mut-dst-unsized.stderr b/tests/ui-nightly/transmute-mut-dst-unsized.stderr index 5e3fbb4bfc..aaeceddcbf 100644 --- a/tests/ui-nightly/transmute-mut-dst-unsized.stderr +++ b/tests/ui-nightly/transmute-mut-dst-unsized.stderr @@ -64,7 +64,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by an implicit `Sized` bound in `transmute` +note: required by an implicit `Sized` bound in `std::intrinsics::transmute` --> $RUST/core/src/intrinsics.rs | | pub fn transmute(src: Src) -> Dst; diff --git a/tests/ui-nightly/transmute-mut-src-dst-unsized.stderr b/tests/ui-nightly/transmute-mut-src-dst-unsized.stderr index 2fe66581f5..bee999c338 100644 --- a/tests/ui-nightly/transmute-mut-src-dst-unsized.stderr +++ b/tests/ui-nightly/transmute-mut-src-dst-unsized.stderr @@ -192,7 +192,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by an implicit `Sized` bound in `transmute` +note: required by an implicit `Sized` bound in `std::intrinsics::transmute` --> $RUST/core/src/intrinsics.rs | | pub fn transmute(src: Src) -> Dst; diff --git a/tests/ui-nightly/transmute-ref-dst-unsized.stderr b/tests/ui-nightly/transmute-ref-dst-unsized.stderr index 1e97b5b0ef..5ad315c477 100644 --- a/tests/ui-nightly/transmute-ref-dst-unsized.stderr +++ b/tests/ui-nightly/transmute-ref-dst-unsized.stderr @@ -47,7 +47,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by an implicit `Sized` bound in `transmute` +note: required by an implicit `Sized` bound in `std::intrinsics::transmute` --> $RUST/core/src/intrinsics.rs | | pub fn transmute(src: Src) -> Dst; diff --git a/tests/ui-nightly/transmute-ref-src-dst-unsized.stderr b/tests/ui-nightly/transmute-ref-src-dst-unsized.stderr index cb1e443ac1..7b4ec90ae4 100644 --- a/tests/ui-nightly/transmute-ref-src-dst-unsized.stderr +++ b/tests/ui-nightly/transmute-ref-src-dst-unsized.stderr @@ -144,7 +144,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by an implicit `Sized` bound in `transmute` +note: required by an implicit `Sized` bound in `std::intrinsics::transmute` --> $RUST/core/src/intrinsics.rs | | pub fn transmute(src: Src) -> Dst; diff --git a/tests/ui-stable/transmute-mut-src-dst-not-references.stderr b/tests/ui-stable/transmute-mut-src-dst-not-references.stderr index b4d02a4aaa..e84fd72ceb 100644 --- a/tests/ui-stable/transmute-mut-src-dst-not-references.stderr +++ b/tests/ui-stable/transmute-mut-src-dst-not-references.stderr @@ -14,6 +14,23 @@ help: consider mutably borrowing here 17 | const SRC_DST_NOT_REFERENCES: &mut usize = transmute_mut!(&mut 0usize); | ++++ +warning: this function depends on never type fallback being `()` + --> tests/ui-stable/transmute-mut-src-dst-not-references.rs:17:1 + | +17 | const SRC_DST_NOT_REFERENCES: &mut usize = transmute_mut!(0usize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #123748 + = help: specify the types explicitly +note: in edition 2024, the requirement `!: FromBytes` will fail + --> tests/ui-stable/transmute-mut-src-dst-not-references.rs:17:44 + | +17 | const SRC_DST_NOT_REFERENCES: &mut usize = transmute_mut!(0usize); + | ^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default + = note: this warning originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) + warning: never type fallback affects this call to an `unsafe` function --> tests/ui-stable/transmute-mut-src-dst-not-references.rs:17:44 | diff --git a/tests/ui-stable/transmute-mut-src-immutable.stderr b/tests/ui-stable/transmute-mut-src-immutable.stderr index 5243e9f87f..1d1f58951a 100644 --- a/tests/ui-stable/transmute-mut-src-immutable.stderr +++ b/tests/ui-stable/transmute-mut-src-immutable.stderr @@ -10,6 +10,23 @@ error[E0308]: mismatched types = note: expected mutable reference `&mut _` found reference `&u8` +warning: this function depends on never type fallback being `()` + --> tests/ui-stable/transmute-mut-src-immutable.rs:15:1 + | +15 | fn ref_src_immutable() { + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #123748 + = help: specify the types explicitly +note: in edition 2024, the requirement `!: FromBytes` will fail + --> tests/ui-stable/transmute-mut-src-immutable.rs:17:22 + | +17 | let _: &mut u8 = transmute_mut!(&0u8); + | ^^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default + = note: this warning originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) + warning: never type fallback affects this call to an `unsafe` function --> tests/ui-stable/transmute-mut-src-immutable.rs:17:22 | diff --git a/tests/ui-stable/transmute-mut-src-not-a-reference.stderr b/tests/ui-stable/transmute-mut-src-not-a-reference.stderr index b685c71d3d..c927ada929 100644 --- a/tests/ui-stable/transmute-mut-src-not-a-reference.stderr +++ b/tests/ui-stable/transmute-mut-src-not-a-reference.stderr @@ -14,6 +14,23 @@ help: consider mutably borrowing here 17 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(&mut 0usize); | ++++ +warning: this function depends on never type fallback being `()` + --> tests/ui-stable/transmute-mut-src-not-a-reference.rs:17:1 + | +17 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(0usize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #123748 + = help: specify the types explicitly +note: in edition 2024, the requirement `!: FromBytes` will fail + --> tests/ui-stable/transmute-mut-src-not-a-reference.rs:17:38 + | +17 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(0usize); + | ^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default + = note: this warning originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) + warning: never type fallback affects this call to an `unsafe` function --> tests/ui-stable/transmute-mut-src-not-a-reference.rs:17:38 | diff --git a/tests/ui-stable/transmute-ref-src-dst-not-references.stderr b/tests/ui-stable/transmute-ref-src-dst-not-references.stderr index 0d57147d94..ec2fbd6c9d 100644 --- a/tests/ui-stable/transmute-ref-src-dst-not-references.stderr +++ b/tests/ui-stable/transmute-ref-src-dst-not-references.stderr @@ -44,6 +44,23 @@ error[E0308]: mismatched types found reference `&_` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) +warning: this function depends on never type fallback being `()` + --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:1 + | +17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #123748 + = help: specify the types explicitly +note: in edition 2024, the requirement `!: AsBytes` will fail + --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:39 + | +17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); + | ^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default + = note: this warning originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) + warning: never type fallback affects this call to an `unsafe` function --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:39 | diff --git a/tests/ui-stable/transmute-ref-src-not-a-reference.stderr b/tests/ui-stable/transmute-ref-src-not-a-reference.stderr index 173766cff5..97e0832229 100644 --- a/tests/ui-stable/transmute-ref-src-not-a-reference.stderr +++ b/tests/ui-stable/transmute-ref-src-not-a-reference.stderr @@ -14,6 +14,23 @@ help: consider borrowing here 17 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(&0usize); | + +warning: this function depends on never type fallback being `()` + --> tests/ui-stable/transmute-ref-src-not-a-reference.rs:17:1 + | +17 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(0usize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #123748 + = help: specify the types explicitly +note: in edition 2024, the requirement `!: AsBytes` will fail + --> tests/ui-stable/transmute-ref-src-not-a-reference.rs:17:34 + | +17 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(0usize); + | ^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default + = note: this warning originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) + warning: never type fallback affects this call to an `unsafe` function --> tests/ui-stable/transmute-ref-src-not-a-reference.rs:17:34 |