File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,19 @@ pub fn export_status(attrs: &[syn::Attribute]) -> ExportStatus {
67
67
} ,
68
68
TokenTree :: Group ( g) => {
69
69
if format ! ( "{}" , single_ident_generic_path_to_ident( & attr. path) . unwrap( ) ) == "cfg" {
70
- if let TokenTree :: Ident ( i) = g. stream ( ) . into_iter ( ) . next ( ) . unwrap ( ) {
71
- if i == "test" || i == "feature" {
70
+ let mut iter = g. stream ( ) . into_iter ( ) ;
71
+ if let TokenTree :: Ident ( i) = iter. next ( ) . unwrap ( ) {
72
+ if i == "any" {
73
+ // #[cfg(any(test, feature = ""))]
74
+ if let TokenTree :: Group ( g) = iter. next ( ) . unwrap ( ) {
75
+ if let TokenTree :: Ident ( i) = g. stream ( ) . into_iter ( ) . next ( ) . unwrap ( ) {
76
+ if i == "test" || i == "feature" {
77
+ // If its cfg(feature(...)) we assume its test-only
78
+ return ExportStatus :: TestOnly ;
79
+ }
80
+ }
81
+ }
82
+ } else if i == "test" || i == "feature" {
72
83
// If its cfg(feature(...)) we assume its test-only
73
84
return ExportStatus :: TestOnly ;
74
85
}
You can’t perform that action at this time.
0 commit comments