@@ -273,7 +273,7 @@ impl SourceRootConfig {
273
273
pub fn load_proc_macro (
274
274
server : & ProcMacroServer ,
275
275
path : & AbsPath ,
276
- dummy_replace : & [ Box < str > ] ,
276
+ ignored_macros : & [ Box < str > ] ,
277
277
) -> ProcMacroLoadResult {
278
278
let res: Result < Vec < _ > , String > = ( || {
279
279
let dylib = MacroDylib :: new ( path. to_path_buf ( ) ) ;
@@ -283,7 +283,7 @@ pub fn load_proc_macro(
283
283
}
284
284
Ok ( vec
285
285
. into_iter ( )
286
- . map ( |expander| expander_to_proc_macro ( expander, dummy_replace ) )
286
+ . map ( |expander| expander_to_proc_macro ( expander, ignored_macros ) )
287
287
. collect ( ) )
288
288
} ) ( ) ;
289
289
match res {
@@ -349,7 +349,7 @@ fn load_crate_graph(
349
349
350
350
fn expander_to_proc_macro (
351
351
expander : proc_macro_api:: ProcMacro ,
352
- dummy_replace : & [ Box < str > ] ,
352
+ ignored_macros : & [ Box < str > ] ,
353
353
) -> ProcMacro {
354
354
let name = From :: from ( expander. name ( ) ) ;
355
355
let kind = match expander. kind ( ) {
@@ -358,7 +358,7 @@ fn expander_to_proc_macro(
358
358
proc_macro_api:: ProcMacroKind :: Attr => ProcMacroKind :: Attr ,
359
359
} ;
360
360
let expander: sync:: Arc < dyn ProcMacroExpander > =
361
- if dummy_replace . iter ( ) . any ( |replace| * * replace == name) {
361
+ if ignored_macros . iter ( ) . any ( |replace| & * * replace == name) {
362
362
match kind {
363
363
ProcMacroKind :: Attr => sync:: Arc :: new ( IdentityExpander ) ,
364
364
_ => sync:: Arc :: new ( EmptyExpander ) ,
@@ -407,6 +407,9 @@ impl ProcMacroExpander for IdentityExpander {
407
407
) -> Result < tt:: Subtree < Span > , ProcMacroExpansionError > {
408
408
Ok ( subtree. clone ( ) )
409
409
}
410
+ fn should_expand ( & self ) -> bool {
411
+ false
412
+ }
410
413
}
411
414
412
415
/// Empty expander, used for proc-macros that are deliberately ignored by the user.
@@ -425,6 +428,9 @@ impl ProcMacroExpander for EmptyExpander {
425
428
) -> Result < tt:: Subtree < Span > , ProcMacroExpansionError > {
426
429
Ok ( tt:: Subtree :: empty ( DelimSpan { open : call_site, close : call_site } ) )
427
430
}
431
+ fn should_expand ( & self ) -> bool {
432
+ false
433
+ }
428
434
}
429
435
430
436
#[ cfg( test) ]
0 commit comments