Skip to main content

Module bridge

Module bridge 

Source
πŸ”¬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.
clientExperimental
Client-side types.
closure πŸ”’ Experimental
Closure type (equivalent to &mut dyn FnMut(Buffer) -> Buffer) that’s repr(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.
panic_message πŸ”’ Experimental
rpc πŸ”’ Experimental
Serialization for client-server communication.
selfless_reify πŸ”’ Experimental
Abstraction for creating fn pointers from any callable that effectively has the equivalent of implementing Default, even if the compiler neither provides Default nor allows reifying closures (i.e. creating fn pointers) other than those with absolutely no captures.
serverExperimental
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Β§

BridgeConfigExperimental
Configuration for establishing an active connection between a server and a client. The server creates the bridge config (run_server in server.rs), then passes it to the client through the function pointer in the run field of client::Client. The client constructs a local Bridge from the config in TLS during its execution (Bridge::{enter, with} in client.rs).
DelimSpanExperimental
DiagnosticExperimental
ExpnGlobalsExperimental
Globals provided alongside the initial inputs for a macro expansion. Provides values such as spans which are used frequently to avoid RPC.
GroupExperimental
IdentExperimental
LiteralExperimental
Marked πŸ”’ Experimental
Methods πŸ”’ Experimental
PunctExperimental

EnumsΒ§

ApiTags πŸ”’ Experimental
LitKindExperimental
TokenTreeExperimental

TraitsΒ§

Mark πŸ”’ Experimental
Helper to wrap associated types to allow trait impl dispatch. That is, normally a pair of impls for T::Foo and T::Bar can overlap, but if the impls are, instead, on types like Marked<T::Foo, Foo> and Marked<T::Bar, Bar>, they can’t.