Skip to content

Commit 4a996c2

Browse files
committed
Begun reorganization of proc_macro crate
1 parent 604d669 commit 4a996c2

File tree

14 files changed

+110
-87
lines changed

14 files changed

+110
-87
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

library/proc_macro/src/bridge/handle.rs renamed to library/proc_macro/src/backend/bridge/handle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::num::NonZero;
66
use std::ops::{Index, IndexMut};
77
use std::sync::atomic::{AtomicU32, Ordering};
88

9-
use super::fxhash::FxHashMap;
9+
use crate::backend::fxhash::FxHashMap;
1010

1111
pub(super) type Handle = NonZero<u32>;
1212

library/proc_macro/src/bridge/mod.rs renamed to library/proc_macro/src/backend/bridge/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,13 @@ macro_rules! reverse_decode {
146146
}
147147
}
148148

149-
#[allow(unsafe_code)]
150-
mod arena;
151149
#[allow(unsafe_code)]
152150
mod buffer;
153151
#[deny(unsafe_code)]
154152
pub mod client;
155153
#[allow(unsafe_code)]
156154
mod closure;
157155
#[forbid(unsafe_code)]
158-
mod fxhash;
159-
#[forbid(unsafe_code)]
160156
mod handle;
161157
#[macro_use]
162158
#[forbid(unsafe_code)]
File renamed without changes.
File renamed without changes.
File renamed without changes.

library/proc_macro/src/bridge/symbol.rs renamed to library/proc_macro/src/backend/bridge/symbol.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ impl<S> DecodeMut<'_, '_, S> for Symbol {
127127

128128
thread_local! {
129129
static INTERNER: RefCell<Interner> = RefCell::new(Interner {
130-
arena: arena::Arena::new(),
131-
names: fxhash::FxHashMap::default(),
130+
arena: crate::backend::arena::Arena::new(),
131+
names: crate::backend::fxhash::FxHashMap::default(),
132132
strings: Vec::new(),
133133
// Start with a base of 1 to make sure that `NonZero<u32>` works.
134134
sym_base: NonZero::new(1).unwrap(),
@@ -137,11 +137,11 @@ thread_local! {
137137

138138
/// Basic interner for a `Symbol`, inspired by the one in `rustc_span`.
139139
struct Interner {
140-
arena: arena::Arena,
140+
arena: crate::backend::arena::Arena,
141141
// SAFETY: These `'static` lifetimes are actually references to data owned
142142
// by the Arena. This is safe, as we never return them as static references
143143
// from `Interner`.
144-
names: fxhash::FxHashMap<&'static str, Symbol>,
144+
names: crate::backend::fxhash::FxHashMap<&'static str, Symbol>,
145145
strings: Vec<&'static str>,
146146
// The offset to apply to symbol names stored in the interner. This is used
147147
// to ensure that symbol names are not re-used after the interner is
@@ -194,6 +194,6 @@ impl Interner {
194194

195195
// SAFETY: This is cleared after the names and strings tables are
196196
// cleared out, so no references into the arena should remain.
197-
self.arena = arena::Arena::new();
197+
self.arena = crate::backend::arena::Arena::new();
198198
}
199199
}

0 commit comments

Comments
 (0)