File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -185,18 +185,19 @@ pub fn metas_in_cfg(cfg: ast::crate_cfg,
185
185
// Pull the inner meta_items from the #[cfg(meta_item, ...)] attributes,
186
186
// so we can match against them. This is the list of configurations for
187
187
// which the item is valid
188
- let cfg_metas =
189
- vec:: concat (
190
- vec:: filter_map ( cfg_metas, |i| attr:: get_meta_item_list ( i) ) ) ;
191
-
192
- let has_cfg_metas = vec:: len ( cfg_metas) > 0 u;
193
- if !has_cfg_metas { return true ; }
194
-
195
- for cfg_metas. each |cfg_mi| {
196
- if attr:: contains ( cfg, * cfg_mi) { return true ; }
197
- }
198
-
199
- return false ;
188
+ let cfg_metas = vec:: filter_map ( cfg_metas, |i| attr:: get_meta_item_list ( i) ) ;
189
+
190
+ if cfg_metas. all ( |c| c. is_empty ( ) ) { return true ; }
191
+
192
+ cfg_metas. any ( |cfg_meta| {
193
+ cfg_meta. all ( |cfg_mi| {
194
+ match cfg_mi. node {
195
+ ast:: meta_list( s, ref it) if * s == ~"not"
196
+ => it. all ( |mi| !attr:: contains ( cfg, * mi) ) ,
197
+ _ => attr:: contains ( cfg, * cfg_mi)
198
+ }
199
+ } )
200
+ } )
200
201
}
201
202
202
203
You can’t perform that action at this time.
0 commit comments