6
6
//! actual IO. See `vfs` and `project_model` in the `rust-analyzer` crate for how
7
7
//! actual IO is done and lowered to input.
8
8
9
- use std:: { fmt, mem, ops, panic :: RefUnwindSafe , str:: FromStr , sync } ;
9
+ use std:: { fmt, mem, ops, str:: FromStr } ;
10
10
11
11
use cfg:: CfgOptions ;
12
12
use la_arena:: { Arena , Idx } ;
@@ -15,13 +15,9 @@ use syntax::SmolStr;
15
15
use triomphe:: Arc ;
16
16
use vfs:: { file_set:: FileSet , AbsPathBuf , AnchoredPath , FileId , VfsPath } ;
17
17
18
- use crate :: span:: SpanData ;
19
-
20
18
// Map from crate id to the name of the crate and path of the proc-macro. If the value is `None`,
21
19
// then the crate for the proc-macro hasn't been build yet as the build data is missing.
22
20
pub type ProcMacroPaths = FxHashMap < CrateId , Result < ( Option < String > , AbsPathBuf ) , String > > ;
23
- pub type ProcMacros = FxHashMap < CrateId , ProcMacroLoadResult > ;
24
-
25
21
/// Files are grouped into source roots. A source root is a directory on the
26
22
/// file systems which is watched for changes. Typically it corresponds to a
27
23
/// Rust crate. Source roots *might* be nested: in this case, a file belongs to
@@ -242,49 +238,8 @@ impl CrateDisplayName {
242
238
CrateDisplayName { crate_name, canonical_name }
243
239
}
244
240
}
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 > ;
279
241
pub type TargetLayoutLoadResult = Result < Arc < str > , Arc < str > > ;
280
242
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
-
288
243
#[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
289
244
pub enum ReleaseChannel {
290
245
Stable ,
0 commit comments