ident,
vis,
id: DUMMY_NODE_ID,
- attrs: variant_attrs,
+ attrs: variant_attrs.into(),
data: struct_def,
disr_expr,
span: vlo.to(this.prev_token.span),
ident: None,
id: DUMMY_NODE_ID,
ty,
- attrs,
+ attrs: attrs.into(),
is_placeholder: false,
},
TrailingToken::MaybeComma,
vis,
id: DUMMY_NODE_ID,
ty,
- attrs,
+ attrs: attrs.into(),
is_placeholder: false,
})
}
self.sess.gated_spans.gate(sym::unnamed_fields, lo);
} else {
let err = if self.check_fn_front_matter(false) {
- let _ = self.parse_fn(&mut Vec::new(), |_| true, lo);
+ // We use `parse_fn` to get a span for the function
+ if let Err(mut db) = self.parse_fn(&mut Vec::new(), |_| true, lo) {
+ db.delay_as_bug();
+ }
let mut err = self.struct_span_err(
lo.to(self.prev_token.span),
&format!("functions are not allowed in {} definitions", adt_ty),