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

Fix sizes of repr(C) enums on hexagon #82379

Merged
merged 1 commit into from
Feb 22, 2021

Conversation

nagisa
Copy link
Member

@nagisa nagisa commented Feb 21, 2021

Enums on hexagon use a smallest size (but at least 1 byte) that fits all
the enumeration values. This is unlike many other ABIs where enums are
at least 32 bits.

Fixes #82100

@rust-highfive
Copy link
Collaborator

r? @estebank

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 21, 2021
@rust-log-analyzer

This comment has been minimized.

Enums on hexagon use a smallest size (but at least 1 byte) that fits all
the enumeration values. This is unlike many other ABIs where enums are
at least 32 bits.
@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Feb 22, 2021

📌 Commit 7130e46 has been approved by estebank

@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-review Status: Awaiting review from the assignee but also interested parties. labels Feb 22, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 22, 2021
Rollup of 9 pull requests

Successful merges:

 - rust-lang#82098 (Add internal `collect_into_array[_unchecked]` to remove duplicate code)
 - rust-lang#82228 (Provide NonZero_c_* integers)
 - rust-lang#82287 (Make "missing field" error message more natural)
 - rust-lang#82351 (Use the first paragraph, instead of cookie-cutter text, for rustdoc descriptions)
 - rust-lang#82353 (rustdoc: Remove unnecessary `Cell` around `param_env`)
 - rust-lang#82367 (remove redundant option/result wrapping of return values)
 - rust-lang#82372 (improve UnsafeCell docs)
 - rust-lang#82379 (Fix sizes of repr(C) enums on hexagon)
 - rust-lang#82382 (rustdoc: Remove `fake_def_ids` RefCell)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 50a2de2 into rust-lang:master Feb 22, 2021
@rustbot rustbot added this to the 1.52.0 milestone Feb 22, 2021
@petrochenkov
Copy link
Contributor

@nagisa
Could you add a

// needs-llvm-components: hexagon

annotation to the added test?
Otherwise it fails unless the hexagon backend for LLVM is built.

@nagisa
Copy link
Member Author

nagisa commented Feb 22, 2021

Definitely, will submit a PR for this later today.

nagisa added a commit to nagisa/rust that referenced this pull request Feb 22, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 24, 2021
…mps, r=petrochenkov

Test hexagon-enum only when llvm target is present

See rust-lang#82379 (comment)

r? `@petrochenkov`

`@bors` rollup
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 24, 2021
…mps, r=petrochenkov

Test hexagon-enum only when llvm target is present

See rust-lang#82379 (comment)

r? ``@petrochenkov``

``@bors`` rollup
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Feb 24, 2021
…mps, r=petrochenkov

Test hexagon-enum only when llvm target is present

See rust-lang#82379 (comment)

r? ```@petrochenkov```

```@bors``` rollup
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 26, 2021
…mps, r=petrochenkov

Test hexagon-enum only when llvm target is present

See rust-lang#82379 (comment)

r? ````@petrochenkov````

````@bors```` rollup
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 27, 2021
…mps, r=petrochenkov

Test hexagon-enum only when llvm target is present

See rust-lang#82379 (comment)

r? `````@petrochenkov`````

`````@bors````` rollup
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 27, 2021
…mps, r=petrochenkov

Test hexagon-enum only when llvm target is present

See rust-lang#82379 (comment)

r? ``````@petrochenkov``````

``````@bors`````` rollup
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

repr(C) on enums is unsound on hexagon-unknown-linux-gnu
7 participants