Skip to content

Commit ab5afca

Browse files
committed
Auto merge of #131045 - compiler-errors:remove-unnamed_fields, r=wesleywiser
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 #117942 Fixes #121161 Fixes #121263 Fixes #121299 Fixes #121722 Fixes #121799 Fixes #126969 Fixes #131041 Tracking: * rust-lang/rust#49804 [^1]: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Unnamed.20struct.2Funion.20fields [^2]: rust-lang/rust#49804 (comment)
2 parents 0323e97 + 1e779b2 commit ab5afca

File tree

2 files changed

+0
-33
lines changed

2 files changed

+0
-33
lines changed

src/types.rs

-2
Original file line numberDiff line numberDiff line change
@@ -951,8 +951,6 @@ impl Rewrite for ast::Ty {
951951
ast::TyKind::Tup(ref items) => {
952952
rewrite_tuple(context, items.iter(), self.span, shape, items.len() == 1)
953953
}
954-
ast::TyKind::AnonStruct(..) => Ok(context.snippet(self.span).to_owned()),
955-
ast::TyKind::AnonUnion(..) => Ok(context.snippet(self.span).to_owned()),
956954
ast::TyKind::Path(ref q_self, ref path) => {
957955
rewrite_path(context, PathContext::Type, q_self, path, shape)
958956
}

tests/target/anonymous-types.rs

-31
This file was deleted.

0 commit comments

Comments
 (0)