@@ -15,8 +15,9 @@ macro_rules! define_handles {
15
15
}
16
16
17
17
impl HandleCounters {
18
- // FIXME(#53451) public to work around `Cannot create local mono-item` ICE.
19
- pub extern "C" fn get( ) -> & ' static Self {
18
+ // FIXME(eddyb) use a reference to the `static COUNTERS`, intead of
19
+ // a wrapper `fn` pointer, once `const fn` can reference `static`s.
20
+ extern "C" fn get( ) -> & ' static Self {
20
21
static COUNTERS : HandleCounters = HandleCounters {
21
22
$( $oty: AtomicUsize :: new( 1 ) , ) *
22
23
$( $ity: AtomicUsize :: new( 1 ) , ) *
@@ -333,14 +334,14 @@ impl Bridge<'_> {
333
334
#[ repr( C ) ]
334
335
#[ derive( Copy , Clone ) ]
335
336
pub struct Client < F > {
337
+ // FIXME(eddyb) use a reference to the `static COUNTERS`, intead of
338
+ // a wrapper `fn` pointer, once `const fn` can reference `static`s.
336
339
pub ( super ) get_handle_counters : extern "C" fn ( ) -> & ' static HandleCounters ,
337
340
pub ( super ) run : extern "C" fn ( Bridge < ' _ > , F ) -> Buffer < u8 > ,
338
341
pub ( super ) f : F ,
339
342
}
340
343
341
- // FIXME(#53451) public to work around `Cannot create local mono-item` ICE,
342
- // affecting not only the function itself, but also the `BridgeState` `thread_local!`.
343
- pub extern "C" fn __run_expand1 (
344
+ extern "C" fn run_expand1 (
344
345
mut bridge : Bridge < ' _ > ,
345
346
f : fn ( crate :: TokenStream ) -> crate :: TokenStream ,
346
347
) -> Buffer < u8 > {
@@ -385,15 +386,13 @@ impl Client<fn(crate::TokenStream) -> crate::TokenStream> {
385
386
pub const fn expand1 ( f : fn ( crate :: TokenStream ) -> crate :: TokenStream ) -> Self {
386
387
Client {
387
388
get_handle_counters : HandleCounters :: get,
388
- run : __run_expand1 ,
389
+ run : run_expand1 ,
389
390
f,
390
391
}
391
392
}
392
393
}
393
394
394
- // FIXME(#53451) public to work around `Cannot create local mono-item` ICE,
395
- // affecting not only the function itself, but also the `BridgeState` `thread_local!`.
396
- pub extern "C" fn __run_expand2 (
395
+ extern "C" fn run_expand2 (
397
396
mut bridge : Bridge < ' _ > ,
398
397
f : fn ( crate :: TokenStream , crate :: TokenStream ) -> crate :: TokenStream ,
399
398
) -> Buffer < u8 > {
@@ -441,7 +440,7 @@ impl Client<fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream> {
441
440
) -> Self {
442
441
Client {
443
442
get_handle_counters : HandleCounters :: get,
444
- run : __run_expand2 ,
443
+ run : run_expand2 ,
445
444
f,
446
445
}
447
446
}
0 commit comments