Skip to content

Commit 6f1f6a6

Browse files
committed
extract error_illegal_c_variadic_ty
1 parent 85d3ed9 commit 6f1f6a6

File tree

1 file changed

+11
-8
lines changed
  • src/librustc_parse/parser

1 file changed

+11
-8
lines changed

src/librustc_parse/parser/ty.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,7 @@ impl<'a> Parser<'a> {
128128
} else {
129129
// FIXME(Centril): Should we just allow `...` syntactically
130130
// anywhere in a type and use semantic restrictions instead?
131-
struct_span_err!(
132-
self.sess.span_diagnostic,
133-
lo.to(self.prev_span),
134-
E0743,
135-
"C-variadic type `...` may not be nested inside another type",
136-
)
137-
.emit();
138-
131+
self.error_illegal_c_varadic_ty(lo);
139132
TyKind::Err
140133
}
141134
} else {
@@ -335,6 +328,16 @@ impl<'a> Parser<'a> {
335328
}
336329
}
337330

331+
fn error_illegal_c_varadic_ty(&self, lo: Span) {
332+
struct_span_err!(
333+
self.sess.span_diagnostic,
334+
lo.to(self.prev_span),
335+
E0743,
336+
"C-variadic type `...` may not be nested inside another type",
337+
)
338+
.emit();
339+
}
340+
338341
pub(super) fn parse_generic_bounds(&mut self,
339342
colon_span: Option<Span>) -> PResult<'a, GenericBounds> {
340343
self.parse_generic_bounds_common(true, colon_span)

0 commit comments

Comments
 (0)