@@ -70,7 +70,12 @@ pub(super) fn parse_cfg_name_directive<'a>(
7070 message: "when the target is {name}"
7171 }
7272 condition ! {
73- name: & target_cfg. os,
73+ name: & [
74+ Some ( & * target_cfg. os) ,
75+ // If something is ignored for emscripten, it likely also needs to be
76+ // ignored for wasm32-unknown-unknown.
77+ ( config. target == "wasm32-unknown-unknown" ) . then_some( "emscripten" ) ,
78+ ] ,
7479 allowed_names: & target_cfgs. all_oses,
7580 message: "when the operative system is {name}"
7681 }
@@ -100,16 +105,9 @@ pub(super) fn parse_cfg_name_directive<'a>(
100105 message: "when the target family is {name}"
101106 }
102107
103- // If something is ignored for emscripten, it likely also needs to be
104- // ignored for wasm32-unknown-unknown.
105108 // `wasm32-bare` is an alias to refer to just wasm32-unknown-unknown
106109 // (in contrast to `wasm32` which also matches non-bare targets like
107110 // asmjs-unknown-emscripten).
108- condition ! {
109- name: "emscripten" ,
110- condition: config. target == "wasm32-unknown-unknown" ,
111- message: "when the target is WASM" ,
112- }
113111 condition ! {
114112 name: "wasm32-bare" ,
115113 condition: config. target == "wasm32-unknown-unknown" ,
@@ -144,7 +142,7 @@ pub(super) fn parse_cfg_name_directive<'a>(
144142 }
145143 condition ! {
146144 name: config. stage_id. split( '-' ) . next( ) . unwrap( ) ,
147- allowed_names: & [ "stable " , "beta " , "nightly " ] ,
145+ allowed_names: & [ "stage0 " , "stage1 " , "stage2 " ] ,
148146 message: "when the bootstrapping stage is {name}" ,
149147 }
150148 condition ! {
@@ -287,6 +285,12 @@ impl<T: CustomMatches> CustomMatches for &[T] {
287285 }
288286}
289287
288+ impl < const N : usize , T : CustomMatches > CustomMatches for [ T ; N ] {
289+ fn custom_matches ( & self , name : & str ) -> bool {
290+ self . iter ( ) . any ( |m| m. custom_matches ( name) )
291+ }
292+ }
293+
290294impl < T : CustomMatches > CustomMatches for Option < T > {
291295 fn custom_matches ( & self , name : & str ) -> bool {
292296 match self {
0 commit comments