66//! actual IO. See `vfs` and `project_model` in the `rust-analyzer` crate for how
77//! actual IO is done and lowered to input.
88
9- use std:: { fmt, mem, ops, panic :: RefUnwindSafe , str:: FromStr , sync } ;
9+ use std:: { fmt, mem, ops, str:: FromStr } ;
1010
1111use cfg:: CfgOptions ;
1212use la_arena:: { Arena , Idx } ;
@@ -15,13 +15,9 @@ use syntax::SmolStr;
1515use triomphe:: Arc ;
1616use vfs:: { file_set:: FileSet , AbsPathBuf , AnchoredPath , FileId , VfsPath } ;
1717
18- use crate :: span:: SpanData ;
19-
2018// Map from crate id to the name of the crate and path of the proc-macro. If the value is `None`,
2119// then the crate for the proc-macro hasn't been build yet as the build data is missing.
2220pub type ProcMacroPaths = FxHashMap < CrateId , Result < ( Option < String > , AbsPathBuf ) , String > > ;
23- pub type ProcMacros = FxHashMap < CrateId , ProcMacroLoadResult > ;
24-
2521/// Files are grouped into source roots. A source root is a directory on the
2622/// file systems which is watched for changes. Typically it corresponds to a
2723/// Rust crate. Source roots *might* be nested: in this case, a file belongs to
@@ -242,49 +238,8 @@ impl CrateDisplayName {
242238 CrateDisplayName { crate_name, canonical_name }
243239 }
244240}
245-
246- // FIXME: These should not be defined in here? Why does base db know about proc-macros
247- // ProcMacroKind is used in [`fixture`], but that module probably shouldn't be in this crate either.
248-
249- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
250- pub struct ProcMacroId ( pub u32 ) ;
251-
252- #[ derive( Copy , Clone , Eq , PartialEq , Debug , Hash ) ]
253- pub enum ProcMacroKind {
254- CustomDerive ,
255- FuncLike ,
256- Attr ,
257- }
258-
259- pub trait ProcMacroExpander : fmt:: Debug + Send + Sync + RefUnwindSafe {
260- fn expand (
261- & self ,
262- subtree : & tt:: Subtree < SpanData > ,
263- attrs : Option < & tt:: Subtree < SpanData > > ,
264- env : & Env ,
265- def_site : SpanData ,
266- call_site : SpanData ,
267- mixed_site : SpanData ,
268- ) -> Result < tt:: Subtree < SpanData > , ProcMacroExpansionError > ;
269- }
270-
271- #[ derive( Debug ) ]
272- pub enum ProcMacroExpansionError {
273- Panic ( String ) ,
274- /// Things like "proc macro server was killed by OOM".
275- System ( String ) ,
276- }
277-
278- pub type ProcMacroLoadResult = Result < Vec < ProcMacro > , String > ;
279241pub type TargetLayoutLoadResult = Result < Arc < str > , Arc < str > > ;
280242
281- #[ derive( Debug , Clone ) ]
282- pub struct ProcMacro {
283- pub name : SmolStr ,
284- pub kind : ProcMacroKind ,
285- pub expander : sync:: Arc < dyn ProcMacroExpander > ,
286- }
287-
288243#[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
289244pub enum ReleaseChannel {
290245 Stable ,
0 commit comments