1
Fork 0

Rename value field to expr to simplify later commits' diffs

This commit is contained in:
Oli Scherer 2024-12-02 11:27:57 +00:00 committed by Jonathan Dönszelmann
parent a611773d80
commit 53b2c7cc95
14 changed files with 28 additions and 30 deletions

View file

@ -1759,7 +1759,7 @@ pub enum AttrArgs {
/// Span of the `=` token.
eq_span: Span,
value: AttrArgsEq,
expr: AttrArgsEq,
},
}
@ -1804,7 +1804,7 @@ impl AttrArgs {
match self {
AttrArgs::Empty => None,
AttrArgs::Delimited(args) => Some(args.dspan.entire()),
AttrArgs::Eq { eq_span, value } => Some(eq_span.to(value.span())),
AttrArgs::Eq { eq_span, expr } => Some(eq_span.to(expr.span())),
}
}
@ -1814,7 +1814,7 @@ impl AttrArgs {
match self {
AttrArgs::Empty => TokenStream::default(),
AttrArgs::Delimited(args) => args.tokens.clone(),
AttrArgs::Eq { value, .. } => TokenStream::from_ast(value.unwrap_ast()),
AttrArgs::Eq { expr, .. } => TokenStream::from_ast(expr.unwrap_ast()),
}
}
}
@ -1828,10 +1828,10 @@ where
match self {
AttrArgs::Empty => {}
AttrArgs::Delimited(args) => args.hash_stable(ctx, hasher),
AttrArgs::Eq { value: AttrArgsEq::Ast(expr), .. } => {
AttrArgs::Eq { expr: AttrArgsEq::Ast(expr), .. } => {
unreachable!("hash_stable {:?}", expr);
}
AttrArgs::Eq { eq_span, value: AttrArgsEq::Hir(lit) } => {
AttrArgs::Eq { eq_span, expr: AttrArgsEq::Hir(lit) } => {
eq_span.hash_stable(ctx, hasher);
lit.hash_stable(ctx, hasher);
}