Skip to content

Parse unnamed fields and anonymous structs or unions (no-recovery) - #115131

Merged
bors merged 1 commit into
rust-lang:masterfrom
frank-king:feature/unnamed-fields-lite
Aug 24, 2023
Merged

Parse unnamed fields and anonymous structs or unions (no-recovery)#115131
bors merged 1 commit into
rust-lang:masterfrom
frank-king:feature/unnamed-fields-lite

Conversation

@frank-king

@frank-kingfrank-king commented Aug 23, 2023

Copy link
Copy Markdown
Contributor

It is part of #114782 which implements #49804. Only parse anonymous structs or unions in struct field definition positions.

r? @petrochenkov

@rustbotrustbot 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 Aug 23, 2023
@rustbot

Copy link
Copy Markdown
Collaborator

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

Comment threadcompiler/rustc_ast/src/token.rs Outdated
Comment threadcompiler/rustc_parse/src/parser/item.rs Outdated
Comment threadcompiler/rustc_parse/src/parser/ty.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

r=me with nits addressed.
@rustbot author

@rustbotrustbot 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 Aug 24, 2023
Anonymous structs or unions are only allowed in struct field
definitions.
Co-authored-by: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com>
@frank-king
frank-kingforce-pushed the feature/unnamed-fields-lite branch from 47f874f to 868706dCompareAugust 24, 2023 03:19
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Aug 24, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 868706d has been approved by petrochenkov

It is now in the queue for this repository.

@borsbors 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 24, 2023
@frank-kingfrank-king changed the title Parse unnamed fields and anonymous structs or unionsParse unnamed fields and anonymous structs or unions (no-recovery)Aug 24, 2023
@bors

bors commented Aug 24, 2023

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 868706d with merge 18be272...

@bors

bors commented Aug 24, 2023

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing 18be272 to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Aug 24, 2023
@bors
bors merged commit 18be272 into rust-lang:masterAug 24, 2023
@rustbotrustbot added this to the 1.74.0 milestone Aug 24, 2023
@frank-king
frank-king deleted the feature/unnamed-fields-lite branch August 24, 2023 14:59
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (18be272): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
0.3%[0.3%, 0.3%]2
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
-0.4%[-0.4%, -0.4%]2
All ❌✅ (primary)--0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

meanrangecount
Regressions ❌
(primary)
2.3%[2.3%, 2.3%]1
Regressions ❌
(secondary)
5.7%[0.9%, 13.4%]8
Improvements ✅
(primary)
-0.8%[-0.8%, -0.8%]1
Improvements ✅
(secondary)
-1.7%[-2.5%, -1.2%]3
All ❌✅ (primary)0.8%[-0.8%, 2.3%]2

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 631.457s -> 630.163s (-0.20%)
Artifact size: 315.81 MiB -> 315.81 MiB (0.00%)

@fmeasefmease added the F-unnamed_fields `#![feature(unnamed_fields)]` label Feb 9, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 11, 2024
…s, r=wesleywiser
Retire the `unnamed_fields` feature for now
`#![feature(unnamed_fields)]` was implemented in part in rust-lang#115131 and rust-lang#115367, however work on that feature has (afaict) stalled and in the mean time there have been some concerns raised (e.g.[^1][^2]) about whether `unnamed_fields` is worthwhile to have in the language, especially in its current desugaring. Because it represents a compiler implementation burden including a new kind of anonymous ADT and additional complication to field selection, and is quite prone to bugs today, I'm choosing to remove the feature.
However, since I'm not one to really write a bunch of words, I'm specifically *not* going to de-RFC this feature. This PR essentially *rolls back* the state of this feature to "RFC accepted but not yet implemented"; however if anyone wants to formally unapprove the RFC from the t-lang side, then please be my guest. I'm just not totally willing to summarize the various language-facing reasons for why this feature is or is not worthwhile, since I'm coming from the compiler side mostly.
Fixesrust-lang#117942Fixesrust-lang#121161Fixesrust-lang#121263Fixesrust-lang#121299Fixesrust-lang#121722Fixesrust-lang#121799Fixesrust-lang#126969Fixesrust-lang#131041
Tracking:
* rust-lang#49804
[^1]: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Unnamed.20struct.2Funion.20fields
[^2]: rust-lang#49804 (comment)
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 11, 2024
…s, r=wesleywiser
Retire the `unnamed_fields` feature for now
`#![feature(unnamed_fields)]` was implemented in part in rust-lang#115131 and rust-lang#115367, however work on that feature has (afaict) stalled and in the mean time there have been some concerns raised (e.g.[^1][^2]) about whether `unnamed_fields` is worthwhile to have in the language, especially in its current desugaring. Because it represents a compiler implementation burden including a new kind of anonymous ADT and additional complication to field selection, and is quite prone to bugs today, I'm choosing to remove the feature.
However, since I'm not one to really write a bunch of words, I'm specifically *not* going to de-RFC this feature. This PR essentially *rolls back* the state of this feature to "RFC accepted but not yet implemented"; however if anyone wants to formally unapprove the RFC from the t-lang side, then please be my guest. I'm just not totally willing to summarize the various language-facing reasons for why this feature is or is not worthwhile, since I'm coming from the compiler side mostly.
Fixesrust-lang#117942Fixesrust-lang#121161Fixesrust-lang#121263Fixesrust-lang#121299Fixesrust-lang#121722Fixesrust-lang#121799Fixesrust-lang#126969Fixesrust-lang#131041
Tracking:
* rust-lang#49804
[^1]: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Unnamed.20struct.2Funion.20fields
[^2]: rust-lang#49804 (comment)
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 18, 2024
…s, r=wesleywiser
Retire the `unnamed_fields` feature for now
`#![feature(unnamed_fields)]` was implemented in part in rust-lang#115131 and rust-lang#115367, however work on that feature has (afaict) stalled and in the mean time there have been some concerns raised (e.g.[^1][^2]) about whether `unnamed_fields` is worthwhile to have in the language, especially in its current desugaring. Because it represents a compiler implementation burden including a new kind of anonymous ADT and additional complication to field selection, and is quite prone to bugs today, I'm choosing to remove the feature.
However, since I'm not one to really write a bunch of words, I'm specifically *not* going to de-RFC this feature. This PR essentially *rolls back* the state of this feature to "RFC accepted but not yet implemented"; however if anyone wants to formally unapprove the RFC from the t-lang side, then please be my guest. I'm just not totally willing to summarize the various language-facing reasons for why this feature is or is not worthwhile, since I'm coming from the compiler side mostly.
Fixesrust-lang#117942Fixesrust-lang#121161Fixesrust-lang#121263Fixesrust-lang#121299Fixesrust-lang#121722Fixesrust-lang#121799Fixesrust-lang#126969Fixesrust-lang#131041
Tracking:
* rust-lang#49804
[^1]: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Unnamed.20struct.2Funion.20fields
[^2]: rust-lang#49804 (comment)
rust-borsBot pushed a commit that referenced this pull request Feb 27, 2026
…eywiser
Retire the `unnamed_fields` feature for now
`#![feature(unnamed_fields)]` was implemented in part in #115131 and #115367, however work on that feature has (afaict) stalled and in the mean time there have been some concerns raised (e.g.[^1][^2]) about whether `unnamed_fields` is worthwhile to have in the language, especially in its current desugaring. Because it represents a compiler implementation burden including a new kind of anonymous ADT and additional complication to field selection, and is quite prone to bugs today, I'm choosing to remove the feature.
However, since I'm not one to really write a bunch of words, I'm specifically *not* going to de-RFC this feature. This PR essentially *rolls back* the state of this feature to "RFC accepted but not yet implemented"; however if anyone wants to formally unapprove the RFC from the t-lang side, then please be my guest. I'm just not totally willing to summarize the various language-facing reasons for why this feature is or is not worthwhile, since I'm coming from the compiler side mostly.
Fixes#117942Fixes#121161Fixes#121263Fixes#121299Fixes#121722Fixes#121799Fixes#126969Fixes#131041
Tracking:
* #49804
[^1]: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Unnamed.20struct.2Funion.20fields
[^2]: #49804 (comment)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-unnamed_fields`#![feature(unnamed_fields)]`merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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.

6 participants

@frank-king@rustbot@petrochenkov@bors@rust-timer@fmease