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

Compute the layout of uninhabited structs #64987

Merged
merged 4 commits into from
Oct 14, 2019

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Oct 2, 2019

fixes #64506

r? @eddyb

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 2, 2019
src/test/ui/issues/issue-64506.rs Outdated Show resolved Hide resolved
src/librustc/ty/layout.rs Outdated Show resolved Hide resolved
assert!(field < count as u64,
"Tried to access field {} of union with {} fields", field, count);
"Tried to access field {} of union {:#?} with {} fields",
field, base.layout, count);
Copy link
Member

Choose a reason for hiding this comment

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

Can you add this assert to FieldPlacement::offset? And even add an offset_u64, if you want (I guess offset(i) can just call offset_u64(i as u64)? or maybe we just want an i: impl Into<u64> on offset).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

u64 does not implement From<usize> :(

@eddyb
Copy link
Member

eddyb commented Oct 14, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Oct 14, 2019

📌 Commit 373c362 has been approved by eddyb

@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 Oct 14, 2019
@bors
Copy link
Contributor

bors commented Oct 14, 2019

⌛ Testing commit 373c362 with merge 2fe9b4b0bf4f8842e26f58d928cf6a5d5153fbfa...

Centril added a commit to Centril/rust that referenced this pull request Oct 14, 2019
…=eddyb

Compute the layout of uninhabited structs

fixes rust-lang#64506

r? @eddyb
@Centril
Copy link
Contributor

Centril commented Oct 14, 2019

@bors retry rolled up.

@bors
Copy link
Contributor

bors commented Oct 14, 2019

⌛ Testing commit 373c362 with merge 434fcab8166c6478551efb023d412fa6e67b0731...

@rust-highfive
Copy link
Collaborator

Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Oct 14, 2019

💔 Test failed - checks-azure

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 14, 2019
@Centril
Copy link
Contributor

Centril commented Oct 14, 2019

@bors retry

@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 Oct 14, 2019
@bors
Copy link
Contributor

bors commented Oct 14, 2019

⌛ Testing commit 373c362 with merge e413dc3...

bors added a commit that referenced this pull request Oct 14, 2019
Compute the layout of uninhabited structs

fixes #64506

r? @eddyb
@alex
Copy link
Member

alex commented Oct 14, 2019

@Centril I assume you noticed, but just in case, FYI every single build appears to be failing on a connection error to the azure ubuntu apt repos.

@pietroalbini
Copy link
Member

@bors treeclosed=1000

@Centril
Copy link
Contributor

Centril commented Oct 14, 2019

@bors treeclose=1000 network problems

@pietroalbini
Copy link
Member

@bors treeclosed-

This build seems to be ok.

@bors
Copy link
Contributor

bors commented Oct 14, 2019

☀️ Test successful - checks-azure
Approved by: eddyb
Pushing e413dc3 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 14, 2019
@bors bors merged commit 373c362 into rust-lang:master Oct 14, 2019
@oli-obk oli-obk deleted the code_reuse_prevents_bugs branch March 6, 2020 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

ICE when const evaluating UB
8 participants