File tree 2 files changed +4
-9
lines changed
2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -83,12 +83,9 @@ impl DefMap {
83
83
}
84
84
85
85
if segments. len ( ) == 1 {
86
- let registered = self . registered_attrs . iter ( ) . map ( SmolStr :: as_str) ;
87
- let is_inert = builtin_attr:: INERT_ATTRIBUTES
88
- . iter ( )
89
- . map ( |it| it. name )
90
- . chain ( registered)
91
- . any ( pred) ;
86
+ let mut registered = self . registered_attrs . iter ( ) . map ( SmolStr :: as_str) ;
87
+ let is_inert =
88
+ builtin_attr:: find_builtin_attr_idx ( & name) . is_some ( ) || registered. any ( pred) ;
92
89
return is_inert;
93
90
}
94
91
}
Original file line number Diff line number Diff line change @@ -2697,9 +2697,7 @@ impl BuiltinAttr {
2697
2697
}
2698
2698
2699
2699
fn builtin ( name : & str ) -> Option < Self > {
2700
- hir_def:: builtin_attr:: INERT_ATTRIBUTES
2701
- . iter ( )
2702
- . position ( |tool| tool. name == name)
2700
+ hir_def:: builtin_attr:: find_builtin_attr_idx ( name)
2703
2701
. map ( |idx| BuiltinAttr { krate : None , idx : idx as u32 } )
2704
2702
}
2705
2703
You can’t perform that action at this time.
0 commit comments