File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
src/librustc_parse/parser Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff 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)
You can’t perform that action at this time.
0 commit comments