@@ -66,7 +66,7 @@ macro_rules! define_handles {
6666 impl <S : server:: Types > DecodeMut <' _, ' _, HandleStore <server:: MarkedTypes <S >>>
6767 for Marked <S :: $oty, $oty>
6868 {
69- fn decode( r: & mut Reader , s: & mut HandleStore <server:: MarkedTypes <S >>) -> Self {
69+ fn decode( r: & mut Reader < ' _> , s: & mut HandleStore <server:: MarkedTypes <S >>) -> Self {
7070 s. $oty. take( handle:: Handle :: decode( r, & mut ( ) ) )
7171 }
7272 }
@@ -80,7 +80,7 @@ macro_rules! define_handles {
8080 impl <S : server:: Types > Decode <' _, ' s, HandleStore <server:: MarkedTypes <S >>>
8181 for & ' s Marked <S :: $oty, $oty>
8282 {
83- fn decode( r: & mut Reader , s: & ' s HandleStore <server:: MarkedTypes <S >>) -> Self {
83+ fn decode( r: & mut Reader < ' _> , s: & ' s HandleStore <server:: MarkedTypes <S >>) -> Self {
8484 & s. $oty[ handle:: Handle :: decode( r, & mut ( ) ) ]
8585 }
8686 }
@@ -94,7 +94,10 @@ macro_rules! define_handles {
9494 impl <S : server:: Types > DecodeMut <' _, ' s, HandleStore <server:: MarkedTypes <S >>>
9595 for & ' s mut Marked <S :: $oty, $oty>
9696 {
97- fn decode( r: & mut Reader , s: & ' s mut HandleStore <server:: MarkedTypes <S >>) -> Self {
97+ fn decode(
98+ r: & mut Reader <' _>,
99+ s: & ' s mut HandleStore <server:: MarkedTypes <S >>
100+ ) -> Self {
98101 & mut s. $oty[ handle:: Handle :: decode( r, & mut ( ) ) ]
99102 }
100103 }
@@ -108,7 +111,7 @@ macro_rules! define_handles {
108111 }
109112
110113 impl <S > DecodeMut <' _, ' _, S > for $oty {
111- fn decode( r: & mut Reader , s: & mut S ) -> Self {
114+ fn decode( r: & mut Reader < ' _> , s: & mut S ) -> Self {
112115 $oty( handle:: Handle :: decode( r, s) )
113116 }
114117 }
@@ -130,7 +133,7 @@ macro_rules! define_handles {
130133 impl <S : server:: Types > DecodeMut <' _, ' _, HandleStore <server:: MarkedTypes <S >>>
131134 for Marked <S :: $ity, $ity>
132135 {
133- fn decode( r: & mut Reader , s: & mut HandleStore <server:: MarkedTypes <S >>) -> Self {
136+ fn decode( r: & mut Reader < ' _> , s: & mut HandleStore <server:: MarkedTypes <S >>) -> Self {
134137 s. $ity. copy( handle:: Handle :: decode( r, & mut ( ) ) )
135138 }
136139 }
@@ -144,7 +147,7 @@ macro_rules! define_handles {
144147 }
145148
146149 impl <S > DecodeMut <' _, ' _, S > for $ity {
147- fn decode( r: & mut Reader , s: & mut S ) -> Self {
150+ fn decode( r: & mut Reader < ' _> , s: & mut S ) -> Self {
148151 $ity( handle:: Handle :: decode( r, s) )
149152 }
150153 }
@@ -200,7 +203,7 @@ impl Clone for Literal {
200203
201204// FIXME(eddyb) `Literal` should not expose internal `Debug` impls.
202205impl fmt:: Debug for Literal {
203- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
206+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
204207 f. write_str ( & self . debug ( ) )
205208 }
206209}
@@ -212,7 +215,7 @@ impl Clone for SourceFile {
212215}
213216
214217impl fmt:: Debug for Span {
215- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
218+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
216219 f. write_str ( & self . debug ( ) )
217220 }
218221}
@@ -275,7 +278,7 @@ impl BridgeState<'_> {
275278 ///
276279 /// N.B., while `f` is running, the thread-local state
277280 /// is `BridgeState::InUse`.
278- fn with < R > ( f : impl FnOnce ( & mut BridgeState ) -> R ) -> R {
281+ fn with < R > ( f : impl FnOnce ( & mut BridgeState < ' _ > ) -> R ) -> R {
279282 BRIDGE_STATE . with ( |state| {
280283 state. replace ( BridgeState :: InUse , |mut state| {
281284 // FIXME(#52812) pass `f` directly to `replace` when `RefMutL` is gone
@@ -306,7 +309,7 @@ impl Bridge<'_> {
306309 BRIDGE_STATE . with ( |state| state. set ( BridgeState :: Connected ( self ) , f) )
307310 }
308311
309- fn with < R > ( f : impl FnOnce ( & mut Bridge ) -> R ) -> R {
312+ fn with < R > ( f : impl FnOnce ( & mut Bridge < ' _ > ) -> R ) -> R {
310313 BridgeState :: with ( |state| match state {
311314 BridgeState :: NotConnected => {
312315 panic ! ( "procedural macro API is used outside of a procedural macro" ) ;
@@ -331,15 +334,15 @@ impl Bridge<'_> {
331334#[ derive( Copy , Clone ) ]
332335pub struct Client < F > {
333336 pub ( super ) get_handle_counters : extern "C" fn ( ) -> & ' static HandleCounters ,
334- pub ( super ) run : extern "C" fn ( Bridge , F ) -> Buffer < u8 > ,
337+ pub ( super ) run : extern "C" fn ( Bridge < ' _ > , F ) -> Buffer < u8 > ,
335338 pub ( super ) f : F ,
336339}
337340
338341// FIXME(#53451) public to work around `Cannot create local mono-item` ICE,
339342// affecting not only the function itself, but also the `BridgeState` `thread_local!`.
340343pub extern "C" fn __run_expand1 (
341- mut bridge : Bridge ,
342- f : fn ( :: TokenStream ) -> :: TokenStream ,
344+ mut bridge : Bridge < ' _ > ,
345+ f : fn ( crate :: TokenStream ) -> crate :: TokenStream ,
343346) -> Buffer < u8 > {
344347 // The initial `cached_buffer` contains the input.
345348 let mut b = bridge. cached_buffer . take ( ) ;
@@ -352,7 +355,7 @@ pub extern "C" fn __run_expand1(
352355 // Put the `cached_buffer` back in the `Bridge`, for requests.
353356 Bridge :: with ( |bridge| bridge. cached_buffer = b. take ( ) ) ;
354357
355- let output = f ( :: TokenStream ( input) ) . 0 ;
358+ let output = f ( crate :: TokenStream ( input) ) . 0 ;
356359
357360 // Take the `cached_buffer` back out, for the output value.
358361 b = Bridge :: with ( |bridge| bridge. cached_buffer . take ( ) ) ;
@@ -378,8 +381,8 @@ pub extern "C" fn __run_expand1(
378381 b
379382}
380383
381- impl Client < fn ( :: TokenStream ) -> :: TokenStream > {
382- pub const fn expand1 ( f : fn ( :: TokenStream ) -> :: TokenStream ) -> Self {
384+ impl Client < fn ( crate :: TokenStream ) -> crate :: TokenStream > {
385+ pub const fn expand1 ( f : fn ( crate :: TokenStream ) -> crate :: TokenStream ) -> Self {
383386 Client {
384387 get_handle_counters : HandleCounters :: get,
385388 run : __run_expand1,
@@ -391,8 +394,8 @@ impl Client<fn(::TokenStream) -> ::TokenStream> {
391394// FIXME(#53451) public to work around `Cannot create local mono-item` ICE,
392395// affecting not only the function itself, but also the `BridgeState` `thread_local!`.
393396pub extern "C" fn __run_expand2 (
394- mut bridge : Bridge ,
395- f : fn ( :: TokenStream , :: TokenStream ) -> :: TokenStream ,
397+ mut bridge : Bridge < ' _ > ,
398+ f : fn ( crate :: TokenStream , crate :: TokenStream ) -> crate :: TokenStream ,
396399) -> Buffer < u8 > {
397400 // The initial `cached_buffer` contains the input.
398401 let mut b = bridge. cached_buffer . take ( ) ;
@@ -406,7 +409,7 @@ pub extern "C" fn __run_expand2(
406409 // Put the `cached_buffer` back in the `Bridge`, for requests.
407410 Bridge :: with ( |bridge| bridge. cached_buffer = b. take ( ) ) ;
408411
409- let output = f ( :: TokenStream ( input) , :: TokenStream ( input2) ) . 0 ;
412+ let output = f ( crate :: TokenStream ( input) , crate :: TokenStream ( input2) ) . 0 ;
410413
411414 // Take the `cached_buffer` back out, for the output value.
412415 b = Bridge :: with ( |bridge| bridge. cached_buffer . take ( ) ) ;
@@ -432,8 +435,10 @@ pub extern "C" fn __run_expand2(
432435 b
433436}
434437
435- impl Client < fn ( :: TokenStream , :: TokenStream ) -> :: TokenStream > {
436- pub const fn expand2 ( f : fn ( :: TokenStream , :: TokenStream ) -> :: TokenStream ) -> Self {
438+ impl Client < fn ( crate :: TokenStream , crate :: TokenStream ) -> crate :: TokenStream > {
439+ pub const fn expand2 (
440+ f : fn ( crate :: TokenStream , crate :: TokenStream ) -> crate :: TokenStream
441+ ) -> Self {
437442 Client {
438443 get_handle_counters : HandleCounters :: get,
439444 run : __run_expand2,
@@ -448,25 +453,25 @@ pub enum ProcMacro {
448453 CustomDerive {
449454 trait_name : & ' static str ,
450455 attributes : & ' static [ & ' static str ] ,
451- client : Client < fn ( :: TokenStream ) -> :: TokenStream > ,
456+ client : Client < fn ( crate :: TokenStream ) -> crate :: TokenStream > ,
452457 } ,
453458
454459 Attr {
455460 name : & ' static str ,
456- client : Client < fn ( :: TokenStream , :: TokenStream ) -> :: TokenStream > ,
461+ client : Client < fn ( crate :: TokenStream , crate :: TokenStream ) -> crate :: TokenStream > ,
457462 } ,
458463
459464 Bang {
460465 name : & ' static str ,
461- client : Client < fn ( :: TokenStream ) -> :: TokenStream > ,
466+ client : Client < fn ( crate :: TokenStream ) -> crate :: TokenStream > ,
462467 } ,
463468}
464469
465470impl ProcMacro {
466471 pub const fn custom_derive (
467472 trait_name : & ' static str ,
468473 attributes : & ' static [ & ' static str ] ,
469- expand : fn ( :: TokenStream ) -> :: TokenStream ,
474+ expand : fn ( crate :: TokenStream ) -> crate :: TokenStream ,
470475 ) -> Self {
471476 ProcMacro :: CustomDerive {
472477 trait_name,
@@ -477,15 +482,18 @@ impl ProcMacro {
477482
478483 pub const fn attr (
479484 name : & ' static str ,
480- expand : fn ( :: TokenStream , :: TokenStream ) -> :: TokenStream ,
485+ expand : fn ( crate :: TokenStream , crate :: TokenStream ) -> crate :: TokenStream ,
481486 ) -> Self {
482487 ProcMacro :: Attr {
483488 name,
484489 client : Client :: expand2 ( expand) ,
485490 }
486491 }
487492
488- pub const fn bang ( name : & ' static str , expand : fn ( :: TokenStream ) -> :: TokenStream ) -> Self {
493+ pub const fn bang (
494+ name : & ' static str ,
495+ expand : fn ( crate :: TokenStream ) -> crate :: TokenStream
496+ ) -> Self {
489497 ProcMacro :: Bang {
490498 name,
491499 client : Client :: expand1 ( expand) ,
0 commit comments