@@ -10,7 +10,7 @@ use rustc_session::Session;
1010use rustc_span:: symbol:: { sym, Ident } ;
1111use rustc_span:: Span ;
1212
13- pub ( crate ) struct Expander ;
13+ pub ( crate ) struct Expander ( pub bool ) ;
1414
1515impl MultiItemModifier for Expander {
1616 fn expand (
@@ -19,6 +19,7 @@ impl MultiItemModifier for Expander {
1919 span : Span ,
2020 meta_item : & ast:: MetaItem ,
2121 item : Annotatable ,
22+ _: bool ,
2223 ) -> ExpandResult < Vec < Annotatable > , Annotatable > {
2324 let sess = ecx. sess ;
2425 if report_bad_target ( sess, & item, span) {
@@ -58,20 +59,20 @@ impl MultiItemModifier for Expander {
5859 report_path_args ( sess, & meta) ;
5960 meta. path
6061 } )
61- . map ( |path| ( path, dummy_annotatable ( ) , None ) )
62+ . map ( |path| ( path, dummy_annotatable ( ) , None , self . 0 ) )
6263 . collect ( ) ;
6364
6465 // Do not configure or clone items unless necessary.
6566 match & mut resolutions[ ..] {
6667 [ ] => { }
67- [ ( _, first_item, _ ) , others @ ..] => {
68+ [ ( _, first_item, .. ) , others @ ..] => {
6869 * first_item = cfg_eval (
6970 sess,
7071 features,
7172 item. clone ( ) ,
7273 ecx. current_expansion . lint_node_id ,
7374 ) ;
74- for ( _, item, _) in others {
75+ for ( _, item, _, _ ) in others {
7576 * item = first_item. clone ( ) ;
7677 }
7778 }
0 commit comments