Skip to content

Commit b3f6494

Browse files
committed
proc_macro: remove now-unnecessary ICE workarounds from bridge::client.
1 parent 8d78bf6 commit b3f6494

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/libproc_macro/bridge/client.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ macro_rules! define_handles {
1515
}
1616

1717
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 {
2021
static COUNTERS: HandleCounters = HandleCounters {
2122
$($oty: AtomicUsize::new(1),)*
2223
$($ity: AtomicUsize::new(1),)*
@@ -333,14 +334,14 @@ impl Bridge<'_> {
333334
#[repr(C)]
334335
#[derive(Copy, Clone)]
335336
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.
336339
pub(super) get_handle_counters: extern "C" fn() -> &'static HandleCounters,
337340
pub(super) run: extern "C" fn(Bridge<'_>, F) -> Buffer<u8>,
338341
pub(super) f: F,
339342
}
340343

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(
344345
mut bridge: Bridge<'_>,
345346
f: fn(crate::TokenStream) -> crate::TokenStream,
346347
) -> Buffer<u8> {
@@ -385,15 +386,13 @@ impl Client<fn(crate::TokenStream) -> crate::TokenStream> {
385386
pub const fn expand1(f: fn(crate::TokenStream) -> crate::TokenStream) -> Self {
386387
Client {
387388
get_handle_counters: HandleCounters::get,
388-
run: __run_expand1,
389+
run: run_expand1,
389390
f,
390391
}
391392
}
392393
}
393394

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(
397396
mut bridge: Bridge<'_>,
398397
f: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream,
399398
) -> Buffer<u8> {
@@ -441,7 +440,7 @@ impl Client<fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream> {
441440
) -> Self {
442441
Client {
443442
get_handle_counters: HandleCounters::get,
444-
run: __run_expand2,
443+
run: run_expand2,
445444
f,
446445
}
447446
}

0 commit comments

Comments
 (0)