aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src/eager.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-18 14:38:04 +0000
committerGitHub <[email protected]>2021-03-18 14:38:04 +0000
commit3ab9b39dd47d99ffd97f485c27f38b8944e12a3e (patch)
tree308ffffd0b61517f13aedad9621430f4c41014e3 /crates/hir_expand/src/eager.rs
parent816bc7389516dda1eb4821f2ac4d5993cd5611dd (diff)
parentb84efbaacfc980ba167edc145aa7ca5d738448ff (diff)
Merge #8087
8087: Make MacroDefId's `AstId` mandatory when possible r=jonas-schievink a=jonas-schievink This makes it clearer (in the type definition) which macros have or don't have an `AstId` bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_expand/src/eager.rs')
-rw-r--r--crates/hir_expand/src/eager.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir_expand/src/eager.rs b/crates/hir_expand/src/eager.rs
index dc618a9ee..ddadaffd3 100644
--- a/crates/hir_expand/src/eager.rs
+++ b/crates/hir_expand/src/eager.rs
@@ -140,7 +140,7 @@ pub fn expand_eager_macro(
140 let subtree = 140 let subtree =
141 diagnostic_sink.option(to_subtree(&result), || err("failed to parse macro result"))?; 141 diagnostic_sink.option(to_subtree(&result), || err("failed to parse macro result"))?;
142 142
143 if let MacroDefKind::BuiltInEager(eager) = def.kind { 143 if let MacroDefKind::BuiltInEager(eager, _) = def.kind {
144 let res = eager.expand(db, arg_id, &subtree); 144 let res = eager.expand(db, arg_id, &subtree);
145 145
146 let (subtree, fragment) = diagnostic_sink.expand_result_option(res)?; 146 let (subtree, fragment) = diagnostic_sink.expand_result_option(res)?;
@@ -193,7 +193,7 @@ fn eager_macro_recur(
193 let def = diagnostic_sink 193 let def = diagnostic_sink
194 .option_with(|| macro_resolver(child.path()?), || err("failed to resolve macro"))?; 194 .option_with(|| macro_resolver(child.path()?), || err("failed to resolve macro"))?;
195 let insert = match def.kind { 195 let insert = match def.kind {
196 MacroDefKind::BuiltInEager(_) => { 196 MacroDefKind::BuiltInEager(..) => {
197 let id: MacroCallId = expand_eager_macro( 197 let id: MacroCallId = expand_eager_macro(
198 db, 198 db,
199 krate, 199 krate,
@@ -206,9 +206,9 @@ fn eager_macro_recur(
206 db.parse_or_expand(id.as_file()) 206 db.parse_or_expand(id.as_file())
207 .expect("successful macro expansion should be parseable") 207 .expect("successful macro expansion should be parseable")
208 } 208 }
209 MacroDefKind::Declarative 209 MacroDefKind::Declarative(_)
210 | MacroDefKind::BuiltIn(_) 210 | MacroDefKind::BuiltIn(..)
211 | MacroDefKind::BuiltInDerive(_) 211 | MacroDefKind::BuiltInDerive(..)
212 | MacroDefKind::ProcMacro(_) => { 212 | MacroDefKind::ProcMacro(_) => {
213 let res = lazy_expand(db, &def, curr.with_value(child.clone()), krate); 213 let res = lazy_expand(db, &def, curr.with_value(child.clone()), krate);
214 let val = diagnostic_sink.expand_result_option(res)?; 214 let val = diagnostic_sink.expand_result_option(res)?;