} else {
// FIXME(Centril): Should we just allow `...` syntactically
// anywhere in a type and use semantic restrictions instead?
- struct_span_err!(
- self.sess.span_diagnostic,
- lo.to(self.prev_span),
- E0743,
- "C-variadic type `...` may not be nested inside another type",
- )
- .emit();
-
+ self.error_illegal_c_varadic_ty(lo);
TyKind::Err
}
} else {
}
}
+ fn error_illegal_c_varadic_ty(&self, lo: Span) {
+ struct_span_err!(
+ self.sess.span_diagnostic,
+ lo.to(self.prev_span),
+ E0743,
+ "C-variadic type `...` may not be nested inside another type",
+ )
+ .emit();
+ }
+
pub(super) fn parse_generic_bounds(&mut self,
colon_span: Option<Span>) -> PResult<'a, GenericBounds> {
self.parse_generic_bounds_common(true, colon_span)