@@ -10,7 +10,7 @@ use rustc_session::Session;
10
10
use rustc_span:: symbol:: { sym, Ident } ;
11
11
use rustc_span:: Span ;
12
12
13
- pub ( crate ) struct Expander ;
13
+ pub ( crate ) struct Expander ( pub bool ) ;
14
14
15
15
impl MultiItemModifier for Expander {
16
16
fn expand (
@@ -19,6 +19,7 @@ impl MultiItemModifier for Expander {
19
19
span : Span ,
20
20
meta_item : & ast:: MetaItem ,
21
21
item : Annotatable ,
22
+ _: bool ,
22
23
) -> ExpandResult < Vec < Annotatable > , Annotatable > {
23
24
let sess = ecx. sess ;
24
25
if report_bad_target ( sess, & item, span) {
@@ -58,20 +59,20 @@ impl MultiItemModifier for Expander {
58
59
report_path_args ( sess, & meta) ;
59
60
meta. path
60
61
} )
61
- . map ( |path| ( path, dummy_annotatable ( ) , None ) )
62
+ . map ( |path| ( path, dummy_annotatable ( ) , None , self . 0 ) )
62
63
. collect ( ) ;
63
64
64
65
// Do not configure or clone items unless necessary.
65
66
match & mut resolutions[ ..] {
66
67
[ ] => { }
67
- [ ( _, first_item, _ ) , others @ ..] => {
68
+ [ ( _, first_item, .. ) , others @ ..] => {
68
69
* first_item = cfg_eval (
69
70
sess,
70
71
features,
71
72
item. clone ( ) ,
72
73
ecx. current_expansion . lint_node_id ,
73
74
) ;
74
- for ( _, item, _) in others {
75
+ for ( _, item, _, _ ) in others {
75
76
* item = first_item. clone ( ) ;
76
77
}
77
78
}
0 commit comments