-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 c_enum_min_bits target spec field, use for arm-none and thumb-none targets #87922
Conversation
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
|
This comment has been minimized.
This comment has been minimized.
af58c42
to
d8fa2db
Compare
@bors try |
⌛ Trying commit 0b973f7da664b296278bf401d198602a0f7cc45a with merge d6fefca960f43fece956faf72cb6b2ac248134a4... |
This comment has been minimized.
This comment has been minimized.
7e1dbe0
to
6ab5094
Compare
@bors try |
⌛ Trying commit 6ab5094d93fb7fa48eda803f2fdf8aeb91c6435f with merge 42cd1bdeeddb458075fbc731d20575a4ceb6941a... |
@bors try seems like it failed with "startup failure" |
⌛ Trying commit 6ab5094d93fb7fa48eda803f2fdf8aeb91c6435f with merge 97161a833baea7332c5c23449259a8e2512afc53... |
@bors try did a push, need a retrigger |
⌛ Trying commit 3b7eda5aca1188f28da10e62c289bb596836c9fc with merge ed376b0496699bb1431b022ef1ea7edb8d45a013... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There's a try build at 97161a833baea7332c5c23449259a8e2512afc53 which can be used. |
r? @nagisa |
Tagging for release notes since this is technically a breaking change. |
#[repr(C)] | ||
enum P { Peach = 0x1000_0000isize, } //~ ERROR: layout_of | ||
|
||
const TANGERINE: usize = 0x8100_0000; // hack to get negative numbers without negation operator! |
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.
Huh, why is this value here like this, you can just write -...
.
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.
Oh, right, #![no_core]
- the "without negation operator" part should probably mention #![no_core]
and #[lang = "neg"]
, it's really confusing on its own.
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.
I copied the other test
#[lang="sized"] | ||
trait Sized {} |
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.
Huh, cool, I guess there is no "code", making this really easy.
// GCC and Clang default to 8 for arm-none here | ||
c_enum_min_bits: 8, |
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.
It might be a good idea to have some deduplication between all the arm*-none-eabi(hf)
target specs, but it doesn't have to happen in this PR.
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.
Implementation LGTM, but I don't know what our policy on adding a new target spec field is.
Targets and interfaces to targets (custom target schemas) aren't considered stable, so from the target changes' perspective this seems good. We're also making Rust more compatible with other targets than less-so. The only use-case I can see breaking here is if Rust code built with different @bors r=nagisa,eddyb |
📌 Commit 5fbb5c93bd38562f4b86327573d5850bb1a3d7f2 has been approved by |
Ah, please squash the commits together. r=nagisa,eddyb after @bors r- |
5fbb5c9
to
4c0e424
Compare
@bors r=nagisa,eddyb |
📌 Commit 4c0e424 has been approved by |
…arth Rollup of 4 pull requests Successful merges: - rust-lang#87916 (Implement `black_box` using intrinsic) - rust-lang#87922 (Add c_enum_min_bits target spec field, use for arm-none and thumb-none targets) - rust-lang#87953 (Improve formatting of closure capture migration suggestion for multi-line closures.) - rust-lang#87965 (Silence non_fmt_panic from external macros.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #87917
Haven't tested this yet, still playing around.This seems to fix the issue.