-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Don't assume primitive type alignments
Previously, we used the `u16` and `u64` types in a number of tests, relying on them having the alignments 2 and 8 respectively. While those types have those alignments on many platforms, those are not guaranteed to be their alignments on all platforms. In this commit, we replace most of these uses with types of the same size but guaranteed alignment. In a few places, we have to leave the uses as-is, but this isn't a big deal since our tests run in CI on platforms where the alignments are actually the values we're relying upon. Closes #116
- Loading branch information
Showing
17 changed files
with
338 additions
and
242 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,44 @@ | ||
error[E0277]: the trait bound `&'static str: FromBytes` is not satisfied | ||
--> tests/ui-msrv/late_compile_pass.rs:18:10 | ||
--> tests/ui-msrv/late_compile_pass.rs:23:10 | ||
| | ||
18 | #[derive(FromBytes)] | ||
23 | #[derive(FromBytes)] | ||
| ^^^^^^^^^ the trait `FromBytes` is not implemented for `&'static str` | ||
| | ||
= help: see issue #48214 | ||
= note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0277]: the trait bound `NotAsBytes: AsBytes` is not satisfied | ||
--> tests/ui-msrv/late_compile_pass.rs:30:10 | ||
--> tests/ui-msrv/late_compile_pass.rs:35:10 | ||
| | ||
30 | #[derive(AsBytes)] | ||
35 | #[derive(AsBytes)] | ||
| ^^^^^^^ the trait `AsBytes` is not implemented for `NotAsBytes` | ||
| | ||
= help: see issue #48214 | ||
= note: this error originates in the derive macro `AsBytes` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0277]: the trait bound `u16: Unaligned` is not satisfied | ||
--> tests/ui-msrv/late_compile_pass.rs:40:10 | ||
error[E0277]: the trait bound `AU16: Unaligned` is not satisfied | ||
--> tests/ui-msrv/late_compile_pass.rs:45:10 | ||
| | ||
40 | #[derive(Unaligned)] | ||
| ^^^^^^^^^ the trait `Unaligned` is not implemented for `u16` | ||
45 | #[derive(Unaligned)] | ||
| ^^^^^^^^^ the trait `Unaligned` is not implemented for `AU16` | ||
| | ||
= help: the following implementations were found: | ||
<i8 as Unaligned> | ||
<u8 as Unaligned> | ||
= help: see issue #48214 | ||
= note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0277]: the trait bound `u16: Unaligned` is not satisfied | ||
--> tests/ui-msrv/late_compile_pass.rs:48:10 | ||
error[E0277]: the trait bound `AU16: Unaligned` is not satisfied | ||
--> tests/ui-msrv/late_compile_pass.rs:53:10 | ||
| | ||
48 | #[derive(Unaligned)] | ||
| ^^^^^^^^^ the trait `Unaligned` is not implemented for `u16` | ||
53 | #[derive(Unaligned)] | ||
| ^^^^^^^^^ the trait `Unaligned` is not implemented for `AU16` | ||
| | ||
= help: the following implementations were found: | ||
<i8 as Unaligned> | ||
<u8 as Unaligned> | ||
= help: see issue #48214 | ||
= note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0277]: the trait bound `u16: Unaligned` is not satisfied | ||
--> tests/ui-msrv/late_compile_pass.rs:55:10 | ||
error[E0277]: the trait bound `AU16: Unaligned` is not satisfied | ||
--> tests/ui-msrv/late_compile_pass.rs:60:10 | ||
| | ||
55 | #[derive(Unaligned)] | ||
| ^^^^^^^^^ the trait `Unaligned` is not implemented for `u16` | ||
60 | #[derive(Unaligned)] | ||
| ^^^^^^^^^ the trait `Unaligned` is not implemented for `AU16` | ||
| | ||
= help: the following implementations were found: | ||
<i8 as Unaligned> | ||
<u8 as Unaligned> | ||
= help: see issue #48214 | ||
= note: this error originates in the derive macro `Unaligned` (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.