Auto merge of #17799 - Veykril:syntax-bridge, r=Veykril

Split out syntax-bridge into a separate crate

This functionality is not really tied to mbe macros, so imo it has no place in that crate.
This commit is contained in:
bors 2024-08-05 12:31:45 +00:00
commit fbed308ebe
30 changed files with 268 additions and 140 deletions

View file

@ -79,6 +79,10 @@ impl SyntaxContextId {
#[derive(Copy, Clone, Hash, PartialEq, Eq)]
pub struct SyntaxContextData {
/// Invariant: Only [`SyntaxContextId::ROOT`] has a [`None`] outer expansion.
// FIXME: The None case needs to encode the context crate id. We can encode that as the MSB of
// MacroCallId is reserved anyways so we can do bit tagging here just fine.
// The bigger issue is that that will cause interning to now create completely separate chains
// per crate. Though that is likely not a problem as `MacroCallId`s are already crate calling dependent.
pub outer_expn: Option<MacroCallId>,
pub outer_transparency: Transparency,
pub parent: SyntaxContextId,