Skip to content

Commit

Permalink
[ci] Don't skip UI tests on zerocopy-derive.
Browse files Browse the repository at this point in the history
This had been done as a workaround for `byteorder` changing error
messages, but `byteorder` is no longer a feature.
  • Loading branch information
jswrenn committed Jan 21, 2024
1 parent 3b7a937 commit 7e966d6
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 191 deletions.
49 changes: 31 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,31 +162,44 @@ jobs:
-- \
--skip ui
if [ "${{ matrix.features }}" != "--no-default-features" -a "${{ matrix.features }}" != "" ]; then
# Run UI tests separately, treating warnings as warnings (rather than
# as errors, as we do everywhere else in our CI tests). This allows
# our UI tests to more accurately reflect what users will see, and
# also ensures that we're not spuriously relying on warnings being
# errors to ensure compilation failure (if we were, then our code
# would be unsound whenever -Dwarnings is not enabled).
#
# TODO(#560), TODO(#187): Once we migrate to the ui-test crate, we
# likely won't have to special-case the UI tests like this.
RUSTFLAGS="$RUSTFLAGS -Wwarnings" ./cargo.sh +${{ matrix.toolchain }} test \
--package ${{ matrix.crate }} \
--target ${{ matrix.target }} \
${{ matrix.features }} \
--verbose \
ui
fi
# Only run tests when targetting x86 (32- or 64-bit) - we're executing on
# x86_64, so we can't run tests for any non-x86 target.
#
# TODO(https://github.com/dtolnay/trybuild/issues/184#issuecomment-1269097742):
# Run compile tests when building for other targets.
if: contains(matrix.target, 'x86_64') || contains(matrix.target, 'i686')

- name: Run UI tests
run: |
# Run UI tests separately, treating warnings as warnings (rather than
# as errors, as we do everywhere else in our CI tests). This allows
# our UI tests to more accurately reflect what users will see, and
# also ensures that we're not spuriously relying on warnings being
# errors to ensure compilation failure (if we were, then our code
# would be unsound whenever -Dwarnings is not enabled).
#
# TODO(#560), TODO(#187): Once we migrate to the ui-test crate, we
# likely won't have to special-case the UI tests like this.
RUSTFLAGS="$RUSTFLAGS -Wwarnings" ./cargo.sh +${{ matrix.toolchain }} test \
--package ${{ matrix.crate }} \
--target ${{ matrix.target }} \
${{ matrix.features }} \
--verbose \
ui
# Only run tests when targetting x86 (32- or 64-bit) - we're executing on
# x86_64, so we can't run tests for any non-x86 target.
#
# TODO(https://github.com/dtolnay/trybuild/issues/184#issuecomment-1269097742):
# Run compile tests when building for other targets.
#
# Only run UI tests for zerocopy-derive, or for zerocopy with the derive
# feature.
if: |
(contains(matrix.target, 'x86_64') || contains(matrix.target, 'i686')) &&
(matrix.crate == 'zerocopy-derive' ||
(matrix.features != '' && matrix.features != '--no-default-features'))
- name: Run tests under Miri
run: |
# Work around https://github.com/rust-lang/miri/issues/3125
Expand Down
32 changes: 20 additions & 12 deletions tests/ui-msrv/include_value_not_from_bytes.stderr
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
error[E0277]: the trait bound `NotZerocopy<u32>: FromBytes` is not satisfied
--> tests/ui-msrv/include_value_not_from_bytes.rs:13:42
|
13 | const NOT_FROM_BYTES: NotZerocopy<u32> = include_value!("../../testdata/include_value/data");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `NotZerocopy<u32>`
|
note: required by a bound in `AssertIsFromBytes`
--> tests/ui-msrv/include_value_not_from_bytes.rs:13:42
|
13 | const NOT_FROM_BYTES: NotZerocopy<u32> = include_value!("../../testdata/include_value/data");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AssertIsFromBytes`
= note: this error originates in the macro `$crate::transmute` (in Nightly builds, run with -Z macro-backtrace for more info)
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
109 changes: 20 additions & 89 deletions zerocopy-derive/tests/ui-msrv/derive_transparent.stderr
Original file line number Diff line number Diff line change
@@ -1,89 +1,20 @@
error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied
--> tests/ui-msrv/derive_transparent.rs:37:1
|
37 | assert_impl_all!(TransparentStruct<NotZerocopy>: TryFromBytes);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy`
|
note: required because of the requirements on the impl of `TryFromBytes` for `TransparentStruct<NotZerocopy>`
--> tests/ui-msrv/derive_transparent.rs:27:21
|
27 | #[derive(IntoBytes, TryFromBytes, FromZeros, FromBytes, Unaligned)]
| ^^^^^^^^^^^^
note: required by a bound in `_::{closure#0}::assert_impl_all`
--> tests/ui-msrv/derive_transparent.rs:37:1
|
37 | assert_impl_all!(TransparentStruct<NotZerocopy>: TryFromBytes);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `_::{closure#0}::assert_impl_all`
= note: this error originates in the macro `assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `NotZerocopy: FromZeroes` is not satisfied
--> tests/ui-msrv/derive_transparent.rs:38:1
|
38 | assert_impl_all!(TransparentStruct<NotZerocopy>: FromZeros);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromZeroes` is not implemented for `NotZerocopy`
|
note: required because of the requirements on the impl of `FromZeroes` for `TransparentStruct<NotZerocopy>`
--> tests/ui-msrv/derive_transparent.rs:27:35
|
27 | #[derive(IntoBytes, TryFromBytes, FromZeros, FromBytes, Unaligned)]
| ^^^^^^^^^
note: required by a bound in `_::{closure#0}::assert_impl_all`
--> tests/ui-msrv/derive_transparent.rs:38:1
|
38 | assert_impl_all!(TransparentStruct<NotZerocopy>: FromZeros);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `_::{closure#0}::assert_impl_all`
= note: this error originates in the macro `assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied
--> tests/ui-msrv/derive_transparent.rs:39:1
|
39 | assert_impl_all!(TransparentStruct<NotZerocopy>: FromBytes);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `NotZerocopy`
|
note: required because of the requirements on the impl of `FromBytes` for `TransparentStruct<NotZerocopy>`
--> tests/ui-msrv/derive_transparent.rs:27:46
|
27 | #[derive(IntoBytes, TryFromBytes, FromZeros, FromBytes, Unaligned)]
| ^^^^^^^^^
note: required by a bound in `_::{closure#0}::assert_impl_all`
--> tests/ui-msrv/derive_transparent.rs:39:1
|
39 | assert_impl_all!(TransparentStruct<NotZerocopy>: FromBytes);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `_::{closure#0}::assert_impl_all`
= note: this error originates in the macro `assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `NotZerocopy: AsBytes` is not satisfied
--> tests/ui-msrv/derive_transparent.rs:40:1
|
40 | assert_impl_all!(TransparentStruct<NotZerocopy>: IntoBytes);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsBytes` is not implemented for `NotZerocopy`
|
note: required because of the requirements on the impl of `AsBytes` for `TransparentStruct<NotZerocopy>`
--> tests/ui-msrv/derive_transparent.rs:27:10
|
27 | #[derive(IntoBytes, TryFromBytes, FromZeros, FromBytes, Unaligned)]
| ^^^^^^^^^
note: required by a bound in `_::{closure#0}::assert_impl_all`
--> tests/ui-msrv/derive_transparent.rs:40:1
|
40 | assert_impl_all!(TransparentStruct<NotZerocopy>: IntoBytes);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `_::{closure#0}::assert_impl_all`
= note: this error originates in the macro `assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `NotZerocopy: Unaligned` is not satisfied
--> tests/ui-msrv/derive_transparent.rs:41:1
|
41 | assert_impl_all!(TransparentStruct<NotZerocopy>: Unaligned);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unaligned` is not implemented for `NotZerocopy`
|
note: required because of the requirements on the impl of `Unaligned` for `TransparentStruct<NotZerocopy>`
--> tests/ui-msrv/derive_transparent.rs:27:57
|
27 | #[derive(IntoBytes, TryFromBytes, FromZeros, FromBytes, Unaligned)]
| ^^^^^^^^^
note: required by a bound in `_::{closure#0}::assert_impl_all`
--> tests/ui-msrv/derive_transparent.rs:41:1
|
41 | assert_impl_all!(TransparentStruct<NotZerocopy>: Unaligned);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `_::{closure#0}::assert_impl_all`
= note: this error originates in the macro `assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info)
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE DO NOT MERGE
24 changes: 0 additions & 24 deletions zerocopy-derive/tests/ui-msrv/struct.stderr
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-msrv/struct.rs:70:8
|
70 | #[repr(packed)]
| ^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-msrv/struct.rs:76:8
|
76 | #[repr(packed(1))]
| ^^^^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-msrv/struct.rs:82:11
|
82 | #[repr(C, packed)]
| ^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-msrv/struct.rs:88:11
|
88 | #[repr(C, packed(1))]
| ^^^^^^^^^

error: unsupported on generic structs that are not repr(transparent) or repr(packed)
--> tests/ui-msrv/struct.rs:97:10
|
Expand Down
24 changes: 0 additions & 24 deletions zerocopy-derive/tests/ui-nightly/struct.stderr
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-nightly/struct.rs:70:8
|
70 | #[repr(packed)]
| ^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-nightly/struct.rs:76:8
|
76 | #[repr(packed(1))]
| ^^^^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-nightly/struct.rs:82:11
|
82 | #[repr(C, packed)]
| ^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-nightly/struct.rs:88:11
|
88 | #[repr(C, packed(1))]
| ^^^^^^^^^

error: unsupported on generic structs that are not repr(transparent) or repr(packed)
--> tests/ui-nightly/struct.rs:97:10
|
Expand Down
24 changes: 0 additions & 24 deletions zerocopy-derive/tests/ui-stable/struct.stderr
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-stable/struct.rs:70:8
|
70 | #[repr(packed)]
| ^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-stable/struct.rs:76:8
|
76 | #[repr(packed(1))]
| ^^^^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-stable/struct.rs:82:11
|
82 | #[repr(C, packed)]
| ^^^^^^

error: cannot derive TryFromBytes with repr(packed)
--> tests/ui-stable/struct.rs:88:11
|
88 | #[repr(C, packed(1))]
| ^^^^^^^^^

error: unsupported on generic structs that are not repr(transparent) or repr(packed)
--> tests/ui-stable/struct.rs:97:10
|
Expand Down

0 comments on commit 7e966d6

Please sign in to comment.