@@ -1370,7 +1370,7 @@ pub trait AsMacroCall {
1370
1370
& self ,
1371
1371
db : & dyn ExpandDatabase ,
1372
1372
krate : CrateId ,
1373
- resolver : impl Fn ( path:: ModPath ) -> Option < MacroDefId > + Copy ,
1373
+ resolver : impl Fn ( & path:: ModPath ) -> Option < MacroDefId > + Copy ,
1374
1374
) -> Option < MacroCallId > {
1375
1375
self . as_call_id_with_errors ( db, krate, resolver) . ok ( ) ?. value
1376
1376
}
@@ -1379,7 +1379,7 @@ pub trait AsMacroCall {
1379
1379
& self ,
1380
1380
db : & dyn ExpandDatabase ,
1381
1381
krate : CrateId ,
1382
- resolver : impl Fn ( path:: ModPath ) -> Option < MacroDefId > + Copy ,
1382
+ resolver : impl Fn ( & path:: ModPath ) -> Option < MacroDefId > + Copy ,
1383
1383
) -> Result < ExpandResult < Option < MacroCallId > > , UnresolvedMacro > ;
1384
1384
}
1385
1385
@@ -1388,7 +1388,7 @@ impl AsMacroCall for InFile<&ast::MacroCall> {
1388
1388
& self ,
1389
1389
db : & dyn ExpandDatabase ,
1390
1390
krate : CrateId ,
1391
- resolver : impl Fn ( path:: ModPath ) -> Option < MacroDefId > + Copy ,
1391
+ resolver : impl Fn ( & path:: ModPath ) -> Option < MacroDefId > + Copy ,
1392
1392
) -> Result < ExpandResult < Option < MacroCallId > > , UnresolvedMacro > {
1393
1393
let expands_to = hir_expand:: ExpandTo :: from_call_site ( self . value ) ;
1394
1394
let ast_id = AstId :: new ( self . file_id , db. ast_id_map ( self . file_id ) . ast_id ( self . value ) ) ;
@@ -1437,7 +1437,7 @@ fn macro_call_as_call_id(
1437
1437
call_site : SyntaxContextId ,
1438
1438
expand_to : ExpandTo ,
1439
1439
krate : CrateId ,
1440
- resolver : impl Fn ( path:: ModPath ) -> Option < MacroDefId > + Copy ,
1440
+ resolver : impl Fn ( & path:: ModPath ) -> Option < MacroDefId > + Copy ,
1441
1441
) -> Result < Option < MacroCallId > , UnresolvedMacro > {
1442
1442
macro_call_as_call_id_with_eager ( db, call, call_site, expand_to, krate, resolver, resolver)
1443
1443
. map ( |res| res. value )
@@ -1449,11 +1449,10 @@ fn macro_call_as_call_id_with_eager(
1449
1449
call_site : SyntaxContextId ,
1450
1450
expand_to : ExpandTo ,
1451
1451
krate : CrateId ,
1452
- resolver : impl FnOnce ( path:: ModPath ) -> Option < MacroDefId > ,
1453
- eager_resolver : impl Fn ( path:: ModPath ) -> Option < MacroDefId > ,
1452
+ resolver : impl FnOnce ( & path:: ModPath ) -> Option < MacroDefId > ,
1453
+ eager_resolver : impl Fn ( & path:: ModPath ) -> Option < MacroDefId > ,
1454
1454
) -> Result < ExpandResult < Option < MacroCallId > > , UnresolvedMacro > {
1455
- let def =
1456
- resolver ( call. path . clone ( ) ) . ok_or_else ( || UnresolvedMacro { path : call. path . clone ( ) } ) ?;
1455
+ let def = resolver ( & call. path ) . ok_or_else ( || UnresolvedMacro { path : call. path . clone ( ) } ) ?;
1457
1456
1458
1457
let res = match def. kind {
1459
1458
MacroDefKind :: BuiltInEager ( ..) => expand_eager_macro_input (
0 commit comments