File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -832,9 +832,14 @@ fn extract_cfgs(attrs: Vec<Attribute>) -> (Vec<Attribute>, Vec<Attribute>) {
832
832
833
833
fn check_for_blacklisted_attrs ( attrs : & [ Attribute ] ) -> Option < TokenStream > {
834
834
if let Some ( val) = containts_blacklist_attrs ( attrs) {
835
- return Some ( parse:: Error :: new ( val. span ( ) , "this attribute is not allowed on a function controlled by cortex-m-rt" )
835
+ return Some (
836
+ parse:: Error :: new (
837
+ val. span ( ) ,
838
+ "this attribute is not allowed on a function controlled by cortex-m-rt" ,
839
+ )
836
840
. to_compile_error ( )
837
- . into ( ) ) ;
841
+ . into ( ) ,
842
+ ) ;
838
843
}
839
844
840
845
None
@@ -843,12 +848,14 @@ fn check_for_blacklisted_attrs(attrs: &[Attribute]) -> Option<TokenStream> {
843
848
fn containts_blacklist_attrs ( attrs : & [ Attribute ] ) -> Option < Attribute > {
844
849
let whitelist = & [ "doc" , "link_section" ] ;
845
850
846
- for attr in attrs {
851
+ ' o : for attr in attrs {
847
852
for val in whitelist {
848
- if ! eq ( & attr, & val) {
849
- return Some ( attr . clone ( ) ) ;
853
+ if eq ( & attr, & val) {
854
+ continue ' o ;
850
855
}
851
856
}
857
+
858
+ return Some ( attr. clone ( ) ) ;
852
859
}
853
860
854
861
None
You can’t perform that action at this time.
0 commit comments