Rollup merge of #88775 - pnkfelix:revert-anon-union-parsing, r=davidtwco
Revert anon union parsing Revert PR #84571 and #85515, which implemented anonymous union parsing in a manner that broke the context-sensitivity for the `union` keyword and thus broke stable Rust code. Fix #88583.
This commit is contained in:
commit
fb2d7dff80
21 changed files with 50 additions and 595 deletions
|
@ -748,10 +748,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
}
|
||||
}
|
||||
|
||||
pub(super) fn lower_field_def(
|
||||
&mut self,
|
||||
(index, f): (usize, &FieldDef),
|
||||
) -> hir::FieldDef<'hir> {
|
||||
fn lower_field_def(&mut self, (index, f): (usize, &FieldDef)) -> hir::FieldDef<'hir> {
|
||||
let ty = if let TyKind::Path(ref qself, ref path) = f.ty.kind {
|
||||
let t = self.lower_path_ty(
|
||||
&f.ty,
|
||||
|
|
|
@ -1301,15 +1301,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||
let kind = match t.kind {
|
||||
TyKind::Infer => hir::TyKind::Infer,
|
||||
TyKind::Err => hir::TyKind::Err,
|
||||
// FIXME(unnamed_fields): IMPLEMENTATION IN PROGRESS
|
||||
TyKind::AnonymousStruct(ref _fields, _recovered) => {
|
||||
self.sess.struct_span_err(t.span, "anonymous structs are unimplemented").emit();
|
||||
hir::TyKind::Err
|
||||
}
|
||||
TyKind::AnonymousUnion(ref _fields, _recovered) => {
|
||||
self.sess.struct_span_err(t.span, "anonymous unions are unimplemented").emit();
|
||||
hir::TyKind::Err
|
||||
}
|
||||
TyKind::Slice(ref ty) => hir::TyKind::Slice(self.lower_ty(ty, itctx)),
|
||||
TyKind::Ptr(ref mt) => hir::TyKind::Ptr(self.lower_mt(mt, itctx)),
|
||||
TyKind::Rptr(ref region, ref mt) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue