@@ -14,6 +14,7 @@ use rustc_ast::{self as ast, AttrStyle, Attribute, HasAttrs, HasTokens, MetaItem
14
14
use rustc_attr as attr;
15
15
use rustc_data_structures:: flat_map_in_place:: FlatMapInPlace ;
16
16
use rustc_data_structures:: fx:: FxHashMap ;
17
+ use rustc_data_structures:: OptionExt as _;
17
18
use rustc_feature:: { Feature , Features , State as FeatureState } ;
18
19
use rustc_feature:: {
19
20
ACCEPTED_FEATURES , ACTIVE_FEATURES , REMOVED_FEATURES , STABLE_REMOVED_FEATURES ,
@@ -427,15 +428,15 @@ impl<'a> StripUnconfigured<'a> {
427
428
return true ;
428
429
}
429
430
} ;
430
- parse_cfg ( & meta_item, & self . sess ) . map_or ( true , |meta_item| {
431
+ parse_cfg ( & meta_item, & self . sess ) . is_none_or ( |meta_item| {
431
432
attr:: cfg_matches ( & meta_item, & self . sess . parse_sess , self . lint_node_id , self . features )
432
433
} )
433
434
}
434
435
435
436
/// If attributes are not allowed on expressions, emit an error for `attr`
436
437
#[ instrument( level = "trace" , skip( self ) ) ]
437
438
pub ( crate ) fn maybe_emit_expr_attr_err ( & self , attr : & Attribute ) {
438
- if !self . features . map_or ( true , |features| features. stmt_expr_attributes ) {
439
+ if !self . features . is_none_or ( |features| features. stmt_expr_attributes ) {
439
440
let mut err = feature_err (
440
441
& self . sess . parse_sess ,
441
442
sym:: stmt_expr_attributes,
0 commit comments