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 error for unsized packed struct field #53342

Merged
merged 1 commit into from
Aug 15, 2018

Conversation

RalfJung
Copy link
Member

It was really confusing to be told "only the last field of a struct may have a dynamically sized type" when only the last field was unsized.

@rust-highfive
Copy link
Collaborator

r? @cramertj

(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 Aug 14, 2018
@cramertj
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 14, 2018

📌 Commit 6bac715dc3935e1932321e85dd2bef60ed0929d8 has been approved by cramertj

@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 Aug 14, 2018
@kennytm
Copy link
Member

kennytm commented Aug 15, 2018

@bors r-

Merge conflict

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 15, 2018
@RalfJung
Copy link
Member Author

I rebased. Strangely, UI tests are now failing somewhere that should not be affected by my patch. The diff created by --bless is

--- a/src/test/ui/macros/macros-nonfatal-errors.stderr
+++ b/src/test/ui/macros/macros-nonfatal-errors.stderr
@@ -1,4 +1,4 @@
-error[E0665]: `Default` cannot be derived for enums, only structs
+error: `Default` cannot be derived for enums, only structs
   --> $DIR/macros-nonfatal-errors.rs:20:10
    |
 LL | #[derive(Default)] //~ ERROR
@@ -96,5 +96,4 @@ LL |     trace_macros!(invalid); //~ ERROR
 
 error: aborting due to 15 previous errors
 
-Some errors occurred: E0658, E0665.
-For more information about an error, try `rustc --explain E0658`.
+For more information about this error, try `rustc --explain E0658`.

@RalfJung
Copy link
Member Author

Ah, this is #53380.

@bors r=cramertj

@bors
Copy link
Contributor

bors commented Aug 15, 2018

📌 Commit 2fd2f9c has been approved by cramertj

@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 Aug 15, 2018
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 15, 2018
fix error for unsized packed struct field

It was really confusing to be told "only the last field of a struct may have a dynamically sized type" when only the last field *was* unsized.
bors added a commit that referenced this pull request Aug 15, 2018
Rollup of 8 pull requests

Successful merges:

 - #52453 (improve diagnostics for tests with custom return values)
 - #53271 (use ? to simplify `TransitiveRelation.maybe_map`)
 - #53279 (Extend documentation of `rustc_on_unimplemented`)
 - #53342 (fix error for unsized packed struct field)
 - #53344 (Add doc examples for std::alloc::{alloc,alloc_zeroed}.)
 - #53368 (Ignore test that fails on stage1)
 - #53388 (Fix links' color)
 - #53396 (Fix since of Iterator::flatten to be a proper semver)

Failed merges:

r? @ghost
@bors bors merged commit 2fd2f9c into rust-lang:master Aug 15, 2018
@RalfJung RalfJung deleted the unsized-packed branch August 16, 2018 10:54
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.

None yet

5 participants