@@ -93,7 +93,7 @@ pub enum ResolvePaths {
9393 Yes ,
9494 No ,
9595}
96- #[ derive( PartialEq , Eq ) ]
96+ #[ derive( Copy , Clone , PartialEq , Eq ) ]
9797pub enum SourceKind {
9898 Source ,
9999 Library ,
@@ -619,7 +619,17 @@ impl<'a> Translator<'a> {
619619 } ) ( ) ;
620620 }
621621
622- pub ( crate ) fn should_be_excluded ( & self , item : & impl ast:: HasAttrs ) -> bool {
622+ pub ( crate ) fn should_be_excluded_attrs ( & self , item : & impl ast:: HasAttrs ) -> bool {
623+ self . semantics . is_some_and ( |sema| {
624+ item. attrs ( ) . any ( |attr| {
625+ attr. as_simple_call ( ) . is_some_and ( |( name, tokens) | {
626+ name == "cfg" && sema. check_cfg_attr ( & tokens) == Some ( false )
627+ } )
628+ } )
629+ } )
630+ }
631+
632+ pub ( crate ) fn should_be_excluded ( & self , item : & impl ast:: AstNode ) -> bool {
623633 if self . source_kind == SourceKind :: Library {
624634 let syntax = item. syntax ( ) ;
625635 if let Some ( body) = syntax. parent ( ) . and_then ( Fn :: cast) . and_then ( |x| x. body ( ) ) {
@@ -645,13 +655,7 @@ impl<'a> Translator<'a> {
645655 }
646656 }
647657 }
648- self . semantics . is_some_and ( |sema| {
649- item. attrs ( ) . any ( |attr| {
650- attr. as_simple_call ( ) . is_some_and ( |( name, tokens) | {
651- name == "cfg" && sema. check_cfg_attr ( & tokens) == Some ( false )
652- } )
653- } )
654- } )
658+ return false ;
655659 }
656660
657661 pub ( crate ) fn extract_types_from_path_segment (
0 commit comments