π¬This is a nightly-only experimental API. (
proc_macro_internals
#27812)Expand description
Internal interface for communicating between a proc_macro
client
(a proc macro crate) and a proc_macro
server (a compiler front-end).
Serialization (with C ABI buffers) and unique integer handles are employed
to allow safely interfacing between two copies of proc_macro
built
(from the same source) by different compilers with potentially mismatching
Rust ABIs (e.g., stage0/bin/rustc vs stage1/bin/rustc during bootstrap).
Re-exportsΒ§
pub use rpc::PanicMessage;
Experimental
ModulesΒ§
- api_
tags πExperimental - arena π
Experimental - A minimal arena allocator inspired by
rustc_arena::DroplessArena
. - buffer π
Experimental - Buffer management for same-process client<->server communication.
- client
Experimental - Client-side types.
- closure π
Experimental - Closure type (equivalent to
&mut dyn FnMut(A) -> R
) thatβsrepr(C)
. - fxhash π
Experimental - This is a copy of the
rustc_hash
crate, adapted to work as a module. - handle π
Experimental - Server-side handles and storage for per-handle data.
- rpc π
Experimental - Serialization for client-server communication.
- selfless_
reify πExperimental - Abstraction for creating
fn
pointers from any callable that effectively has the equivalent of implementingDefault
, even if the compiler neither providesDefault
nor allows reifying closures (i.e. creatingfn
pointers) other than those with absolutely no captures. - server
Experimental - Server-side traits.
- symbol π
Experimental - Client-side interner used for symbols.
MacrosΒ§
- compound_
traits πExperimental - mark_
compound πExperimental - mark_
noop πExperimental - reverse_
decode πExperimental - reverse_
encode πExperimental - with_
api πExperimental - Higher-order macro describing the server RPC API, allowing automatic generation of type-safe Rust APIs, both client-side and server-side.
- with_
api_ πhandle_ types Experimental
StructsΒ§
- Bridge
Config Experimental - Configuration for establishing an active connection between a server and a
client. The server creates the bridge config (
run_server
inserver.rs
), then passes it to the client through the function pointer in therun
field ofclient::Client
. The client constructs a localBridge
from the config in TLS during its execution (Bridge::{enter, with}
inclient.rs
). - Delim
Span Experimental - Diagnostic
Experimental - Expn
Globals Experimental - Globals provided alongside the initial inputs for a macro expansion. Provides values such as spans which are used frequently to avoid RPC.
- Group
Experimental - Ident
Experimental - Literal
Experimental - Marked π
Experimental - Punct
Experimental
EnumsΒ§
TraitsΒ§
- Mark π
Experimental - Helper to wrap associated types to allow trait impl dispatch.
That is, normally a pair of impls for
T::Foo
andT::Bar
can overlap, but if the impls are, instead, on types likeMarked<T::Foo, Foo>
andMarked<T::Bar, Bar>
, they canβt. - Unmark π
Experimental - Unwrap types wrapped by
Mark::mark
(seeMark
for details).