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> {
697697 match fn_ctxt {
698698 FnCtxt :: Foreign => return ,
699699 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 } ) ;
706715 }
707- _ => {
716+ Extern :: None => {
708717 self . dcx ( ) . emit_err ( errors:: BadCVariadic { span : variadic_param. span } ) ;
709718 }
710719 } ,
You can’t perform that action at this time.
0 commit comments