@@ -17,16 +17,47 @@ use crate::{
17
17
18
18
#[ derive( Debug , PartialEq , Eq ) ]
19
19
pub enum DefDiagnosticKind {
20
- UnresolvedModule { ast : AstId < ast:: Module > , candidates : Box < [ String ] > } ,
21
- UnresolvedExternCrate { ast : AstId < ast:: ExternCrate > } ,
22
- UnresolvedImport { id : ItemTreeId < item_tree:: Use > , index : Idx < ast:: UseTree > } ,
23
- UnconfiguredCode { ast : ErasedAstId , cfg : CfgExpr , opts : CfgOptions } ,
24
- UnresolvedProcMacro { ast : MacroCallKind , krate : CrateId } ,
25
- UnresolvedMacroCall { ast : MacroCallKind , path : ModPath } ,
26
- UnimplementedBuiltinMacro { ast : AstId < ast:: Macro > } ,
27
- InvalidDeriveTarget { ast : AstId < ast:: Item > , id : usize } ,
28
- MalformedDerive { ast : AstId < ast:: Adt > , id : usize } ,
29
- MacroDefError { ast : AstId < ast:: Macro > , message : String } ,
20
+ UnresolvedModule {
21
+ ast : AstId < ast:: Module > ,
22
+ candidates : Box < [ String ] > ,
23
+ } ,
24
+ UnresolvedExternCrate {
25
+ ast : AstId < ast:: ExternCrate > ,
26
+ } ,
27
+ UnresolvedImport {
28
+ id : ItemTreeId < item_tree:: Use > ,
29
+ index : Idx < ast:: UseTree > ,
30
+ } ,
31
+ UnconfiguredCode {
32
+ ast : ErasedAstId ,
33
+ cfg : CfgExpr ,
34
+ opts : CfgOptions ,
35
+ } ,
36
+ /// A proc-macro that is lacking an expander, this might be due to build scripts not yet having
37
+ /// run or proc-macro expansion being disabled.
38
+ UnresolvedProcMacro {
39
+ ast : MacroCallKind ,
40
+ krate : CrateId ,
41
+ } ,
42
+ UnresolvedMacroCall {
43
+ ast : MacroCallKind ,
44
+ path : ModPath ,
45
+ } ,
46
+ UnimplementedBuiltinMacro {
47
+ ast : AstId < ast:: Macro > ,
48
+ } ,
49
+ InvalidDeriveTarget {
50
+ ast : AstId < ast:: Item > ,
51
+ id : usize ,
52
+ } ,
53
+ MalformedDerive {
54
+ ast : AstId < ast:: Adt > ,
55
+ id : usize ,
56
+ } ,
57
+ MacroDefError {
58
+ ast : AstId < ast:: Macro > ,
59
+ message : String ,
60
+ } ,
30
61
}
31
62
32
63
#[ derive( Clone , Debug , PartialEq , Eq ) ]
@@ -92,10 +123,6 @@ impl DefDiagnostic {
92
123
Self { in_module : container, kind : DefDiagnosticKind :: UnconfiguredCode { ast, cfg, opts } }
93
124
}
94
125
95
- // FIXME: Whats the difference between this and unresolved_macro_call
96
- // FIXME: This is used for a lot of things, unresolved proc macros, disabled proc macros, etc
97
- // yet the diagnostic handler in ide-diagnostics has to figure out what happened because this
98
- // struct loses all that information!
99
126
pub fn unresolved_proc_macro (
100
127
container : LocalModuleId ,
101
128
ast : MacroCallKind ,
0 commit comments