π¬This is a nightly-only experimental API. (
proc_macro_internals)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 panic_message::PanicMessage;Experimental
ModulesΒ§
- 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(Buffer) -> Buffer) thatβsrepr(C). - fxhash π
Experimental - This is a copy of the
rustc_hashcrate, adapted to work as a module. - handle π
Experimental - Server-side handles and storage for per-handle data.
- panic_
message πExperimental - rpc π
Experimental - Serialization for client-server communication.
- selfless_
reify πExperimental - Abstraction for creating
fnpointers from any callable that effectively has the equivalent of implementingDefault, even if the compiler neither providesDefaultnor allows reifying closures (i.e. creatingfnpointers) other than those with absolutely no captures. - server
Experimental - Server-side traits.
- symbol π
Experimental - Client-side interner used for symbols.
MacrosΒ§
- compound_
traits πExperimental - declare_
tags πExperimental - mark_
compound πExperimental - mark_
noop π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.
StructsΒ§
- Bridge
Config Experimental - Configuration for establishing an active connection between a server and a
client. The server creates the bridge config (
run_serverinserver.rs), then passes it to the client through the function pointer in therunfield ofclient::Client. The client constructs a localBridgefrom 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 - Methods π
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::FooandT::Barcan overlap, but if the impls are, instead, on types likeMarked<T::Foo, Foo>andMarked<T::Bar, Bar>, they canβt.