File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed
compiler/rustc_ast_passes/src Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -697,14 +697,23 @@ impl<'a> AstValidator<'a> {
697
697
match fn_ctxt {
698
698
FnCtxt :: Foreign => return ,
699
699
FnCtxt :: Free => match sig. header . ext {
700
- Extern :: Explicit ( StrLit { symbol_unescaped : sym:: C , .. } , _)
701
- | Extern :: Explicit ( StrLit { symbol_unescaped : sym:: C_dash_unwind , .. } , _)
702
- | Extern :: Implicit ( _)
703
- if matches ! ( sig. header. safety, Safety :: Unsafe ( _) ) =>
704
- {
705
- return ;
700
+ Extern :: Implicit ( _) => {
701
+ if matches ! ( sig. header. safety, Safety :: Unsafe ( _) ) {
702
+ return ;
703
+ }
704
+
705
+ self . dcx ( ) . emit_err ( errors:: BadCVariadic { span : variadic_param. span } ) ;
706
+ }
707
+ Extern :: Explicit ( StrLit { symbol_unescaped, .. } , _) => {
708
+ if matches ! ( symbol_unescaped, sym:: C | sym:: C_dash_unwind ) {
709
+ if matches ! ( sig. header. safety, Safety :: Unsafe ( _) ) {
710
+ return ;
711
+ }
712
+ }
713
+
714
+ self . dcx ( ) . emit_err ( errors:: BadCVariadic { span : variadic_param. span } ) ;
706
715
}
707
- _ => {
716
+ Extern :: None => {
708
717
self . dcx ( ) . emit_err ( errors:: BadCVariadic { span : variadic_param. span } ) ;
709
718
}
710
719
} ,
You can’t perform that action at this time.
0 commit comments