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

Add language tests for aggregate types #133355

Merged
merged 2 commits into from
Nov 23, 2024

Conversation

chorman0773
Copy link
Contributor

This adds some tests for struct and union types, ensuring that they satisfy the rules for all structs and unions - namely that fields of structs do not overlap, fields are well-aligned, and the size of the entire.

The reference annotations used are from rust-lang/reference#1654, though the rules tested here were FCPed in rust-lang/reference#1152.

@rustbot
Copy link
Collaborator

rustbot commented Nov 23, 2024

r? @petrochenkov

rustbot has assigned @petrochenkov.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 23, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this mostly looks good to me, except for the #[cfg_attr(test, test)] and #[cfg(not(test))] attributes.

tests/ui/layout/aggregate-lang/struct-align.rs Outdated Show resolved Hide resolved
tests/ui/layout/aggregate-lang/struct-align.rs Outdated Show resolved Hide resolved
@jieyouxu
Copy link
Member

r? jieyouxu

@rustbot rustbot assigned jieyouxu and unassigned petrochenkov Nov 23, 2024
@jieyouxu
Copy link
Member

You can r=me after removing those --test-related annotations and PR CI is green.
@bors delegate+

@bors
Copy link
Contributor

bors commented Nov 23, 2024

✌️ @chorman0773, you can now approve this pull request!

If @jieyouxu told you to "r=me" after making some further change, please make that change, then do @bors r=@jieyouxu

@jieyouxu jieyouxu added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 23, 2024
@chorman0773
Copy link
Contributor Author

@bors r=@jieyouxu

@bors
Copy link
Contributor

bors commented Nov 23, 2024

📌 Commit 8578ccc has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 23, 2024
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Nov 23, 2024
…ieyouxu

Add language tests for aggregate types

This adds some tests for struct and union types, ensuring that they satisfy the rules for all structs and unions - namely that fields of structs do not overlap, fields are well-aligned, and the size of the entire.

The reference annotations used are from rust-lang/reference#1654, though the rules tested here were FCPed in <rust-lang/reference#1152>.
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 23, 2024
Rollup of 4 pull requests

Successful merges:

 - rust-lang#133217 ([AIX] Add option -X32_64 to the "strip" command)
 - rust-lang#133237 (Minimally constify `Add`)
 - rust-lang#133355 (Add language tests for aggregate types)
 - rust-lang#133374 (show abi_unsupported_vector_types lint in future breakage reports)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ae4fdf1 into rust-lang:master Nov 23, 2024
6 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Nov 23, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 23, 2024
Rollup merge of rust-lang#133355 - chorman0773:spec-layout-tests, r=jieyouxu

Add language tests for aggregate types

This adds some tests for struct and union types, ensuring that they satisfy the rules for all structs and unions - namely that fields of structs do not overlap, fields are well-aligned, and the size of the entire.

The reference annotations used are from rust-lang/reference#1654, though the rules tested here were FCPed in <rust-lang/reference#1152>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants