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> {
128
128
} else {
129
129
// FIXME(Centril): Should we just allow `...` syntactically
130
130
// 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) ;
139
132
TyKind :: Err
140
133
}
141
134
} else {
@@ -335,6 +328,16 @@ impl<'a> Parser<'a> {
335
328
}
336
329
}
337
330
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
+
338
341
pub ( super ) fn parse_generic_bounds ( & mut self ,
339
342
colon_span : Option < Span > ) -> PResult < ' a , GenericBounds > {
340
343
self . parse_generic_bounds_common ( true , colon_span)
You can’t perform that action at this time.
0 commit comments