File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -465,7 +465,19 @@ fn check_if_attr_is_complete(source: &str, edition: Edition) -> Option<AttrKind>
465
465
} else if attr_name == sym:: no_std {
466
466
Some ( AttrKind :: NoStd )
467
467
} else if not_crate_attrs. contains ( & attr_name) {
468
- Some ( AttrKind :: Attr )
468
+ // There is one exception to these attributes:
469
+ // `#![allow(internal_features)]`. If this attribute is used, we need to
470
+ // consider it only as a crate-level attribute.
471
+ if attr_name == sym:: allow
472
+ && let Some ( list) = attr. meta_item_list ( )
473
+ && list. iter ( ) . any ( |sub_attr| {
474
+ sub_attr. name_or_empty ( ) . as_str ( ) == "internal_features"
475
+ } )
476
+ {
477
+ Some ( AttrKind :: CrateAttr )
478
+ } else {
479
+ Some ( AttrKind :: Attr )
480
+ }
469
481
} else {
470
482
Some ( AttrKind :: CrateAttr )
471
483
}
You can’t perform that action at this time.
0 commit comments