@@ -139,7 +139,7 @@ pub fn time_trace_profiler_finish(file_name: &str) {
139
139
// to LLVM or the feature detection code will walk past the end of the feature
140
140
// array, leading to crashes.
141
141
142
- const ARM_WHITELIST : & [ ( & str , Option < Symbol > ) ] = & [
142
+ const ARM_ALLOWED_FEATURES : & [ ( & str , Option < Symbol > ) ] = & [
143
143
( "aclass" , Some ( sym:: arm_target_feature) ) ,
144
144
( "mclass" , Some ( sym:: arm_target_feature) ) ,
145
145
( "rclass" , Some ( sym:: arm_target_feature) ) ,
@@ -162,7 +162,7 @@ const ARM_WHITELIST: &[(&str, Option<Symbol>)] = &[
162
162
( "thumb-mode" , Some ( sym:: arm_target_feature) ) ,
163
163
] ;
164
164
165
- const AARCH64_WHITELIST : & [ ( & str , Option < Symbol > ) ] = & [
165
+ const AARCH64_ALLOWED_FEATURES : & [ ( & str , Option < Symbol > ) ] = & [
166
166
( "fp" , Some ( sym:: aarch64_target_feature) ) ,
167
167
( "neon" , Some ( sym:: aarch64_target_feature) ) ,
168
168
( "sve" , Some ( sym:: aarch64_target_feature) ) ,
@@ -180,7 +180,7 @@ const AARCH64_WHITELIST: &[(&str, Option<Symbol>)] = &[
180
180
( "v8.3a" , Some ( sym:: aarch64_target_feature) ) ,
181
181
] ;
182
182
183
- const X86_WHITELIST : & [ ( & str , Option < Symbol > ) ] = & [
183
+ const X86_ALLOWED_FEATURES : & [ ( & str , Option < Symbol > ) ] = & [
184
184
( "adx" , Some ( sym:: adx_target_feature) ) ,
185
185
( "aes" , None ) ,
186
186
( "avx" , None ) ,
@@ -224,12 +224,12 @@ const X86_WHITELIST: &[(&str, Option<Symbol>)] = &[
224
224
( "xsaves" , None ) ,
225
225
] ;
226
226
227
- const HEXAGON_WHITELIST : & [ ( & str , Option < Symbol > ) ] = & [
227
+ const HEXAGON_ALLOWED_FEATURES : & [ ( & str , Option < Symbol > ) ] = & [
228
228
( "hvx" , Some ( sym:: hexagon_target_feature) ) ,
229
229
( "hvx-length128b" , Some ( sym:: hexagon_target_feature) ) ,
230
230
] ;
231
231
232
- const POWERPC_WHITELIST : & [ ( & str , Option < Symbol > ) ] = & [
232
+ const POWERPC_ALLOWED_FEATURES : & [ ( & str , Option < Symbol > ) ] = & [
233
233
( "altivec" , Some ( sym:: powerpc_target_feature) ) ,
234
234
( "power8-altivec" , Some ( sym:: powerpc_target_feature) ) ,
235
235
( "power9-altivec" , Some ( sym:: powerpc_target_feature) ) ,
@@ -238,10 +238,10 @@ const POWERPC_WHITELIST: &[(&str, Option<Symbol>)] = &[
238
238
( "vsx" , Some ( sym:: powerpc_target_feature) ) ,
239
239
] ;
240
240
241
- const MIPS_WHITELIST : & [ ( & str , Option < Symbol > ) ] =
241
+ const MIPS_ALLOWED_FEATURES : & [ ( & str , Option < Symbol > ) ] =
242
242
& [ ( "fp64" , Some ( sym:: mips_target_feature) ) , ( "msa" , Some ( sym:: mips_target_feature) ) ] ;
243
243
244
- const RISCV_WHITELIST : & [ ( & str , Option < Symbol > ) ] = & [
244
+ const RISCV_ALLOWED_FEATURES : & [ ( & str , Option < Symbol > ) ] = & [
245
245
( "m" , Some ( sym:: riscv_target_feature) ) ,
246
246
( "a" , Some ( sym:: riscv_target_feature) ) ,
247
247
( "c" , Some ( sym:: riscv_target_feature) ) ,
@@ -250,7 +250,7 @@ const RISCV_WHITELIST: &[(&str, Option<Symbol>)] = &[
250
250
( "e" , Some ( sym:: riscv_target_feature) ) ,
251
251
] ;
252
252
253
- const WASM_WHITELIST : & [ ( & str , Option < Symbol > ) ] = & [
253
+ const WASM_ALLOWED_FEATURES : & [ ( & str , Option < Symbol > ) ] = & [
254
254
( "simd128" , Some ( sym:: wasm_target_feature) ) ,
255
255
( "atomics" , Some ( sym:: wasm_target_feature) ) ,
256
256
( "nontrapping-fptoint" , Some ( sym:: wasm_target_feature) ) ,
@@ -259,19 +259,18 @@ const WASM_WHITELIST: &[(&str, Option<Symbol>)] = &[
259
259
/// When rustdoc is running, provide a list of all known features so that all their respective
260
260
/// primitives may be documented.
261
261
///
262
- /// IMPORTANT: If you're adding another whitelist to the above lists, make sure to add it to this
263
- /// iterator!
262
+ /// IMPORTANT: If you're adding another feature list above, make sure to add it to this iterator!
264
263
pub fn all_known_features ( ) -> impl Iterator < Item = ( & ' static str , Option < Symbol > ) > {
265
- ARM_WHITELIST
266
- . iter ( )
264
+ std:: iter:: empty ( )
265
+ . chain ( ARM_ALLOWED_FEATURES . iter ( ) )
266
+ . chain ( AARCH64_ALLOWED_FEATURES . iter ( ) )
267
+ . chain ( X86_ALLOWED_FEATURES . iter ( ) )
268
+ . chain ( HEXAGON_ALLOWED_FEATURES . iter ( ) )
269
+ . chain ( POWERPC_ALLOWED_FEATURES . iter ( ) )
270
+ . chain ( MIPS_ALLOWED_FEATURES . iter ( ) )
271
+ . chain ( RISCV_ALLOWED_FEATURES . iter ( ) )
272
+ . chain ( WASM_ALLOWED_FEATURES . iter ( ) )
267
273
. cloned ( )
268
- . chain ( AARCH64_WHITELIST . iter ( ) . cloned ( ) )
269
- . chain ( X86_WHITELIST . iter ( ) . cloned ( ) )
270
- . chain ( HEXAGON_WHITELIST . iter ( ) . cloned ( ) )
271
- . chain ( POWERPC_WHITELIST . iter ( ) . cloned ( ) )
272
- . chain ( MIPS_WHITELIST . iter ( ) . cloned ( ) )
273
- . chain ( RISCV_WHITELIST . iter ( ) . cloned ( ) )
274
- . chain ( WASM_WHITELIST . iter ( ) . cloned ( ) )
275
274
}
276
275
277
276
pub fn to_llvm_feature < ' a > ( sess : & Session , s : & ' a str ) -> & ' a str {
@@ -289,7 +288,7 @@ pub fn to_llvm_feature<'a>(sess: &Session, s: &'a str) -> &'a str {
289
288
290
289
pub fn target_features ( sess : & Session ) -> Vec < Symbol > {
291
290
let target_machine = create_informational_target_machine ( sess) ;
292
- target_feature_whitelist ( sess)
291
+ supported_target_features ( sess)
293
292
. iter ( )
294
293
. filter_map ( |& ( feature, gate) | {
295
294
if UnstableFeatures :: from_environment ( ) . is_nightly_build ( ) || gate. is_none ( ) {
@@ -307,16 +306,16 @@ pub fn target_features(sess: &Session) -> Vec<Symbol> {
307
306
. collect ( )
308
307
}
309
308
310
- pub fn target_feature_whitelist ( sess : & Session ) -> & ' static [ ( & ' static str , Option < Symbol > ) ] {
309
+ pub fn supported_target_features ( sess : & Session ) -> & ' static [ ( & ' static str , Option < Symbol > ) ] {
311
310
match & * sess. target . target . arch {
312
- "arm" => ARM_WHITELIST ,
313
- "aarch64" => AARCH64_WHITELIST ,
314
- "x86" | "x86_64" => X86_WHITELIST ,
315
- "hexagon" => HEXAGON_WHITELIST ,
316
- "mips" | "mips64" => MIPS_WHITELIST ,
317
- "powerpc" | "powerpc64" => POWERPC_WHITELIST ,
318
- "riscv32" | "riscv64" => RISCV_WHITELIST ,
319
- "wasm32" => WASM_WHITELIST ,
311
+ "arm" => ARM_ALLOWED_FEATURES ,
312
+ "aarch64" => AARCH64_ALLOWED_FEATURES ,
313
+ "x86" | "x86_64" => X86_ALLOWED_FEATURES ,
314
+ "hexagon" => HEXAGON_ALLOWED_FEATURES ,
315
+ "mips" | "mips64" => MIPS_ALLOWED_FEATURES ,
316
+ "powerpc" | "powerpc64" => POWERPC_ALLOWED_FEATURES ,
317
+ "riscv32" | "riscv64" => RISCV_ALLOWED_FEATURES ,
318
+ "wasm32" => WASM_ALLOWED_FEATURES ,
320
319
_ => & [ ] ,
321
320
}
322
321
}
0 commit comments