Rename to CustomDerive

This commit is contained in:
Edwin Cheng 2020-03-24 03:45:52 +08:00
parent 7667aa6033
commit 8afb445357
5 changed files with 5 additions and 5 deletions

View File

@ -892,7 +892,7 @@ fn collect_proc_macro(&mut self, attrs: &Attrs) {
let macro_id = MacroDefId {
ast_id: None,
krate: Some(krate),
kind: MacroDefKind::ProcMacro(expander),
kind: MacroDefKind::CustomDerive(expander),
};
self.def_collector.define_proc_macro(name.clone(), macro_id);

View File

@ -135,7 +135,7 @@ pub(crate) fn macro_def(
Some(Arc::new((TokenExpander::BuiltinDerive(expander), mbe::TokenMap::default())))
}
MacroDefKind::BuiltInEager(_) => None,
MacroDefKind::ProcMacro(expander) => {
MacroDefKind::CustomDerive(expander) => {
Some(Arc::new((TokenExpander::ProcMacro(expander), mbe::TokenMap::default())))
}
}

View File

@ -113,7 +113,7 @@ fn eager_macro_recur(
MacroDefKind::Declarative
| MacroDefKind::BuiltIn(_)
| MacroDefKind::BuiltInDerive(_)
| MacroDefKind::ProcMacro(_) => {
| MacroDefKind::CustomDerive(_) => {
let expanded = lazy_expand(db, &def, curr.with_value(child.clone()))?;
// replace macro inside
eager_macro_recur(db, expanded, macro_resolver)?

View File

@ -30,7 +30,7 @@ pub fn new(db: &dyn AstDatabase, file_id: HirFileId) -> Hygiene {
MacroDefKind::BuiltIn(_) => None,
MacroDefKind::BuiltInDerive(_) => None,
MacroDefKind::BuiltInEager(_) => None,
MacroDefKind::ProcMacro(_) => None,
MacroDefKind::CustomDerive(_) => None,
}
}
MacroCallId::EagerMacro(_id) => None,

View File

@ -219,7 +219,7 @@ pub enum MacroDefKind {
// FIXME: maybe just Builtin and rename BuiltinFnLikeExpander to BuiltinExpander
BuiltInDerive(BuiltinDeriveExpander),
BuiltInEager(EagerExpander),
ProcMacro(ProcMacroExpander),
CustomDerive(ProcMacroExpander),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]