-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tests] Fix UI tests with missing imports #706
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
error[E0405]: cannot find trait `FromBytes` in this scope | ||
--> tests/ui-msrv/transmute-mut-src-generic.rs:15:31 | ||
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types | ||
--> tests/ui-msrv/transmute-mut-src-generic.rs:17:5 | ||
| | ||
15 | fn transmute_mut<T: AsBytes + FromBytes + NoCell>(t: &mut T) -> &mut u8 { | ||
| ^^^^^^^^^ not found in this scope | ||
17 | transmute_mut!(t) | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
help: consider importing this trait | ||
= note: source type: `T` (this type does not have a fixed size) | ||
= note: target type: `u8` (8 bits) | ||
= note: this error originates in the macro `$crate::assert_size_eq` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types | ||
--> tests/ui-msrv/transmute-mut-src-generic.rs:17:5 | ||
| | ||
11 | use zerocopy::FromBytes; | ||
17 | transmute_mut!(t) | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: source type: `AlignOf<T>` (size can vary because of T) | ||
= note: target type: `MaxAlignsOf<T, u8>` (size can vary because of T) | ||
= note: this error originates in the macro `$crate::assert_align_gt_eq` (in Nightly builds, run with -Z macro-backtrace for more info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
error[E0405]: cannot find trait `FromBytes` in this scope | ||
--> tests/ui-nightly/transmute-mut-src-generic.rs:15:31 | ||
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types | ||
--> tests/ui-nightly/transmute-mut-src-generic.rs:17:5 | ||
| | ||
15 | fn transmute_mut<T: AsBytes + FromBytes + NoCell>(t: &mut T) -> &mut u8 { | ||
| ^^^^^^^^^ not found in this scope | ||
17 | transmute_mut!(t) | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
help: consider importing this trait | ||
= note: source type: `T` (this type does not have a fixed size) | ||
= note: target type: `u8` (8 bits) | ||
= note: this error originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types | ||
--> tests/ui-nightly/transmute-mut-src-generic.rs:17:5 | ||
| | ||
11 + use zerocopy::FromBytes; | ||
17 | transmute_mut!(t) | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: source type: `AlignOf<T>` (size can vary because of T) | ||
= note: target type: `MaxAlignsOf<T, u8>` (size can vary because of T) | ||
= note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
error[E0405]: cannot find trait `FromBytes` in this scope | ||
--> tests/ui-stable/transmute-mut-src-generic.rs:15:31 | ||
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types | ||
--> tests/ui-stable/transmute-mut-src-generic.rs:17:5 | ||
| | ||
15 | fn transmute_mut<T: AsBytes + FromBytes + NoCell>(t: &mut T) -> &mut u8 { | ||
| ^^^^^^^^^ not found in this scope | ||
17 | transmute_mut!(t) | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
help: consider importing this trait | ||
= note: source type: `T` (this type does not have a fixed size) | ||
= note: target type: `u8` (8 bits) | ||
= note: this error originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types | ||
--> tests/ui-stable/transmute-mut-src-generic.rs:17:5 | ||
| | ||
11 + use zerocopy::FromBytes; | ||
17 | transmute_mut!(t) | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: source type: `AlignOf<T>` (size can vary because of T) | ||
= note: target type: `MaxAlignsOf<T, u8>` (size can vary because of T) | ||
= note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) |
113 changes: 57 additions & 56 deletions
113
zerocopy-derive/tests/ui-msrv/derive_transparent.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,89 @@ | ||
<<<<<<< HEAD | ||
error[E0277]: the trait bound `NotZerocopy: FromZeroes` is not satisfied | ||
error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied | ||
--> tests/ui-msrv/derive_transparent.rs:37:1 | ||
| | ||
37 | assert_impl_all!(TransparentStruct<NotZerocopy>: FromZeros); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromZeroes` is not implemented for `NotZerocopy` | ||
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 `FromZeroes` for `TransparentStruct<NotZerocopy>` | ||
note: required because of the requirements on the impl of `TryFromBytes` for `TransparentStruct<NotZerocopy>` | ||
--> tests/ui-msrv/derive_transparent.rs:27:19 | ||
| | ||
27 | #[derive(AsBytes, FromZeros, FromBytes, Unaligned)] | ||
| ^^^^^^^^^ | ||
27 | #[derive(AsBytes, 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>: FromZeros); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `_::{closure#0}::assert_impl_all` | ||
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: FromBytes` is not satisfied | ||
error[E0277]: the trait bound `NotZerocopy: FromZeroes` is not satisfied | ||
--> tests/ui-msrv/derive_transparent.rs:38:1 | ||
======= | ||
error: cannot find derive macro `TryFromBytes` in this scope | ||
--> tests/ui-msrv/derive_transparent.rs:27:19 | ||
| | ||
27 | #[derive(AsBytes, TryFromBytes, FromZeroes, FromBytes, Unaligned)] | ||
| ^^^^^^^^^^^^ help: a derive macro with a similar name exists: `FromBytes` | ||
>>>>>>> [derive] Support `derive(TryFromBytes)` for structs | ||
| | ||
::: src/lib.rs | ||
38 | assert_impl_all!(TransparentStruct<NotZerocopy>: FromZeros); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromZeroes` is not implemented for `NotZerocopy` | ||
| | ||
<<<<<<< HEAD | ||
note: required because of the requirements on the impl of `FromBytes` for `TransparentStruct<NotZerocopy>` | ||
--> tests/ui-msrv/derive_transparent.rs:27:30 | ||
note: required because of the requirements on the impl of `FromZeroes` for `TransparentStruct<NotZerocopy>` | ||
--> tests/ui-msrv/derive_transparent.rs:27:33 | ||
| | ||
27 | #[derive(AsBytes, FromZeros, FromBytes, Unaligned)] | ||
| ^^^^^^^^^ | ||
27 | #[derive(AsBytes, 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>: FromBytes); | ||
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) | ||
======= | ||
| pub fn derive_from_bytes(ts: proc_macro::TokenStream) -> proc_macro::TokenStream { | ||
| -------------------------------------------------------------------------------- similarly named derive macro `FromBytes` defined here | ||
| | ||
= note: consider importing one of these items: | ||
zerocopy::TryFromBytes | ||
zerocopy_derive::TryFromBytes | ||
>>>>>>> [derive] Support `derive(TryFromBytes)` for structs | ||
|
||
error[E0405]: cannot find trait `TryFromBytes` in this scope | ||
--> tests/ui-msrv/derive_transparent.rs:37:50 | ||
error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied | ||
--> tests/ui-msrv/derive_transparent.rs:39:1 | ||
| | ||
37 | assert_impl_all!(TransparentStruct<NotZerocopy>: TryFromBytes); | ||
| ^^^^^^^^^^^^ | ||
39 | assert_impl_all!(TransparentStruct<NotZerocopy>: FromBytes); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `NotZerocopy` | ||
| | ||
<<<<<<< HEAD | ||
27 | #[derive(AsBytes, FromZeros, FromBytes, Unaligned)] | ||
| ^^^^^^^ | ||
note: required because of the requirements on the impl of `FromBytes` for `TransparentStruct<NotZerocopy>` | ||
--> tests/ui-msrv/derive_transparent.rs:27:44 | ||
| | ||
27 | #[derive(AsBytes, TryFromBytes, FromZeros, FromBytes, Unaligned)] | ||
| ^^^^^^^^^ | ||
note: required by a bound in `_::{closure#0}::assert_impl_all` | ||
--> tests/ui-msrv/derive_transparent.rs:39:1 | ||
======= | ||
::: $WORKSPACE/src/lib.rs | ||
>>>>>>> [derive] Support `derive(TryFromBytes)` for structs | ||
| | ||
| pub unsafe trait FromBytes: FromZeroes { | ||
| -------------------------------------- similarly named trait `FromBytes` defined here | ||
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 | ||
| | ||
help: a trait with a similar name exists | ||
40 | assert_impl_all!(TransparentStruct<NotZerocopy>: AsBytes); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsBytes` is not implemented for `NotZerocopy` | ||
| | ||
<<<<<<< HEAD | ||
note: required because of the requirements on the impl of `Unaligned` for `TransparentStruct<NotZerocopy>` | ||
--> tests/ui-msrv/derive_transparent.rs:27:41 | ||
note: required because of the requirements on the impl of `AsBytes` for `TransparentStruct<NotZerocopy>` | ||
--> tests/ui-msrv/derive_transparent.rs:27:10 | ||
| | ||
27 | #[derive(AsBytes, FromZeros, FromBytes, Unaligned)] | ||
| ^^^^^^^^^ | ||
27 | #[derive(AsBytes, TryFromBytes, FromZeros, FromBytes, Unaligned)] | ||
| ^^^^^^^ | ||
note: required by a bound in `_::{closure#0}::assert_impl_all` | ||
--> tests/ui-msrv/derive_transparent.rs:40:1 | ||
======= | ||
37 | assert_impl_all!(TransparentStruct<NotZerocopy>: FromBytes); | ||
| ~~~~~~~~~ | ||
help: consider importing this trait | ||
| | ||
14 | use zerocopy::TryFromBytes; | ||
>>>>>>> [derive] Support `derive(TryFromBytes)` for structs | ||
40 | assert_impl_all!(TransparentStruct<NotZerocopy>: AsBytes); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:55 | ||
| | ||
27 | #[derive(AsBytes, 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh oh. The fact that this slipped through suggests that these tests aren't actually getting validated...