Currently, proc-macro crates require a lot of special-casing like the following:
|
pub fn get_def(&self, index: DefIndex) -> Option<Def> { |
|
if !self.is_proc_macro(index) { |
|
self.entry(index).kind.to_def(self.local_def_id(index)) |
|
} else { |
|
let kind = self.proc_macros.as_ref().unwrap()[index.to_proc_macro_index()].1.kind(); |
|
Some(Def::Macro(self.local_def_id(index), kind)) |
|
} |
|
} |
I wonder if this is really necessary. It would be preferable if proc-macro crates could be treated as regular crates.
cc @rust-lang/compiler @jseyfried
Currently, proc-macro crates require a lot of special-casing like the following:
rust/src/librustc_metadata/decoder.rs
Lines 503 to 510 in b176285
I wonder if this is really necessary. It would be preferable if proc-macro crates could be treated as regular crates.
cc @rust-lang/compiler @jseyfried