Clarify field name

This commit is contained in:
Jonas Schievink 2021-05-19 20:23:26 +02:00
parent ea8555b155
commit c0d93bc4d6
4 changed files with 6 additions and 6 deletions

View file

@ -625,7 +625,7 @@ mod tests {
def, def,
krate, krate,
eager: Some(EagerCallInfo { eager: Some(EagerCallInfo {
expansion: Arc::new(parsed_args.clone()), arg_or_expansion: Arc::new(parsed_args.clone()),
included_file: None, included_file: None,
}), }),
kind: MacroCallKind::FnLike { ast_id: call_id, fragment: FragmentKind::Expr }, kind: MacroCallKind::FnLike { ast_id: call_id, fragment: FragmentKind::Expr },
@ -636,7 +636,7 @@ mod tests {
def, def,
krate, krate,
eager: Some(EagerCallInfo { eager: Some(EagerCallInfo {
expansion: Arc::new(expanded.subtree), arg_or_expansion: Arc::new(expanded.subtree),
included_file: expanded.included_file, included_file: expanded.included_file,
}), }),
kind: MacroCallKind::FnLike { ast_id: call_id, fragment: expanded.fragment }, kind: MacroCallKind::FnLike { ast_id: call_id, fragment: expanded.fragment },

View file

@ -329,7 +329,7 @@ fn macro_expand_with_arg(
); );
} else { } else {
return ExpandResult { return ExpandResult {
value: Some(eager.expansion.clone()), value: Some(eager.arg_or_expansion.clone()),
// FIXME: There could be errors here! // FIXME: There could be errors here!
err: None, err: None,
}; };

View file

@ -122,7 +122,7 @@ pub fn expand_eager_macro(
def, def,
krate, krate,
eager: Some(EagerCallInfo { eager: Some(EagerCallInfo {
expansion: Arc::new(parsed_args.clone()), arg_or_expansion: Arc::new(parsed_args.clone()),
included_file: None, included_file: None,
}), }),
kind: MacroCallKind::FnLike { ast_id: call_id, fragment: FragmentKind::Expr }, kind: MacroCallKind::FnLike { ast_id: call_id, fragment: FragmentKind::Expr },
@ -149,7 +149,7 @@ pub fn expand_eager_macro(
def, def,
krate, krate,
eager: Some(EagerCallInfo { eager: Some(EagerCallInfo {
expansion: Arc::new(expanded.subtree), arg_or_expansion: Arc::new(expanded.subtree),
included_file: expanded.included_file, included_file: expanded.included_file,
}), }),
kind: MacroCallKind::FnLike { ast_id: call_id, fragment: expanded.fragment }, kind: MacroCallKind::FnLike { ast_id: call_id, fragment: expanded.fragment },

View file

@ -231,7 +231,7 @@ pub enum MacroDefKind {
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
struct EagerCallInfo { struct EagerCallInfo {
/// NOTE: This can be *either* the expansion result, *or* the argument to the eager macro! /// NOTE: This can be *either* the expansion result, *or* the argument to the eager macro!
expansion: Arc<tt::Subtree>, arg_or_expansion: Arc<tt::Subtree>,
included_file: Option<FileId>, included_file: Option<FileId>,
} }