@@ -130,19 +130,31 @@ fn require_c_abi_if_c_variadic(
130
130
let extern_system_varargs = tcx. features ( ) . extern_system_varargs ( ) ;
131
131
let conventions = if extended_abi_support { CONVENTIONS_UNSTABLE } else { CONVENTIONS_STABLE } ;
132
132
match abi {
133
- // User enabled additional ABI support for varargs and function ABI matches those ones.
134
- ExternAbi :: System { .. } if extern_system_varargs => return ,
135
- abi if abi. supports_varargs ( ) && extended_abi_support => return ,
136
-
137
- // Using this ABI would be ok, if the feature for additional ABI support was enabled.
138
133
ExternAbi :: System { .. } => {
139
- feature_err ( & tcx. sess , sym:: extern_system_varargs, span, UNSTABLE_EXPLAIN ) . emit ( ) ;
134
+ // User enabled additional ABI support for varargs and function ABI matches those ones.
135
+ if extern_system_varargs {
136
+ return ;
137
+ } else {
138
+ // Using this ABI would be ok, if the feature for additional ABI support was enabled.
139
+ feature_err ( & tcx. sess , sym:: extern_system_varargs, span, UNSTABLE_EXPLAIN ) . emit ( ) ;
140
+ }
140
141
}
141
142
abi => {
142
- if abi. supports_varargs ( ) && !extended_abi_support {
143
- feature_err ( & tcx. sess , sym:: extended_varargs_abi_support, span, UNSTABLE_EXPLAIN )
143
+ if abi. supports_varargs ( ) {
144
+ // User enabled additional ABI support for varargs and function ABI matches those ones.
145
+ if extended_abi_support {
146
+ return ;
147
+ } else {
148
+ // Using this ABI would be ok, if the feature for additional ABI support was enabled.
149
+ feature_err (
150
+ & tcx. sess ,
151
+ sym:: extended_varargs_abi_support,
152
+ span,
153
+ UNSTABLE_EXPLAIN ,
154
+ )
144
155
. emit ( ) ;
145
- } ;
156
+ } ;
157
+ }
146
158
}
147
159
} ;
148
160
0 commit comments