Switch AstDatabase::exapnd_proc_macro to ExpandResult

This commit is contained in:
Lukas Wirth 2021-08-20 14:34:46 +02:00
parent 269de9abe3
commit 82728eb757
3 changed files with 18 additions and 35 deletions

View file

@ -1,5 +1,6 @@
//! Builtin attributes.
use mbe::ExpandResult;
use syntax::ast;
use crate::{db::AstDatabase, name, AstId, CrateId, MacroCallId, MacroDefId, MacroDefKind};
@ -18,7 +19,7 @@ macro_rules! register_builtin {
id: MacroCallId,
tt: &tt::Subtree,
item: &tt::Subtree,
) -> Result<tt::Subtree, mbe::ExpandError> {
) -> ExpandResult<tt::Subtree> {
let expander = match *self {
$( BuiltinAttrExpander::$variant => $expand, )*
};
@ -64,6 +65,6 @@ fn dummy_attr_expand(
_id: MacroCallId,
_tt: &tt::Subtree,
item: &tt::Subtree,
) -> Result<tt::Subtree, mbe::ExpandError> {
Ok(item.clone())
) -> ExpandResult<tt::Subtree> {
ExpandResult::ok(item.clone())
}