Skip to content
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

[ci.yml] Test zerocopy-derive in CI #27

Merged
merged 1 commit into from
Oct 6, 2022
Merged

[ci.yml] Test zerocopy-derive in CI #27

merged 1 commit into from
Oct 6, 2022

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Oct 5, 2022

No description provided.

@joshlf joshlf force-pushed the test-derive branch 6 times, most recently from cb75d88 to 2c218fa Compare October 6, 2022 01:28
In some cases, zerocopy-derive performs its analysis by emitting code
which the Rust compiler will reject if implementing a particular trait
would not be sound. This means that, when the rustc's error messages
change, so do zerocopy-derive's. We have "UI" tests which attempt to
comile invalid code, and expect that it is rejected in the appropriate
way. These tests are dependent upon the exact error messages produced in
different cases.

Since rustc sometimes changes its error messages between versions, this
means that a single set of UI tests cannot be correct for all Rust
versions. In this commit, we split our UI tests - we keep one copy of
the source `.rs` files, but multiple copies of the expected error
messages, one per toolchain pinned in CI.
@joshlf joshlf merged commit 2c3bf40 into main Oct 6, 2022
@joshlf joshlf deleted the test-derive branch October 6, 2022 01:42
joshlf added a commit that referenced this pull request Aug 3, 2023
In some cases, zerocopy-derive performs its analysis by emitting code
which the Rust compiler will reject if implementing a particular trait
would not be sound. This means that, when the rustc's error messages
change, so do zerocopy-derive's. We have "UI" tests which attempt to
comile invalid code, and expect that it is rejected in the appropriate
way. These tests are dependent upon the exact error messages produced in
different cases.

Since rustc sometimes changes its error messages between versions, this
means that a single set of UI tests cannot be correct for all Rust
versions. In this commit, we split our UI tests - we keep one copy of
the source `.rs` files, but multiple copies of the expected error
messages, one per toolchain pinned in CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant