Skip to content

Commit 687925c

Browse files
jdonszelmannoli-obk
authored andcommitted
Add hir::Attribute
1 parent b61c7c4 commit 687925c

File tree

88 files changed

+1140
-659
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1140
-659
lines changed

Cargo.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3727,6 +3727,7 @@ dependencies = [
37273727
"rustc_span",
37283728
"rustc_target",
37293729
"smallvec",
3730+
"thin-vec",
37303731
"tracing",
37313732
]
37323733

@@ -4395,9 +4396,9 @@ version = "0.0.0"
43954396
dependencies = [
43964397
"rustc_abi",
43974398
"rustc_ast",
4398-
"rustc_ast_pretty",
43994399
"rustc_data_structures",
44004400
"rustc_hir",
4401+
"rustc_hir_pretty",
44014402
"rustc_middle",
44024403
"rustc_session",
44034404
"rustc_span",

compiler/rustc_ast/src/ast.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,7 @@ pub enum AttrArgs {
17351735
/// Span of the `=` token.
17361736
eq_span: Span,
17371737

1738-
expr: AttrArgsEq,
1738+
expr: P<Expr>,
17391739
},
17401740
}
17411741

@@ -1780,7 +1780,7 @@ impl AttrArgs {
17801780
match self {
17811781
AttrArgs::Empty => None,
17821782
AttrArgs::Delimited(args) => Some(args.dspan.entire()),
1783-
AttrArgs::Eq { eq_span, expr } => Some(eq_span.to(expr.span())),
1783+
AttrArgs::Eq { eq_span, expr } => Some(eq_span.to(expr.span)),
17841784
}
17851785
}
17861786

@@ -1790,7 +1790,7 @@ impl AttrArgs {
17901790
match self {
17911791
AttrArgs::Empty => TokenStream::default(),
17921792
AttrArgs::Delimited(args) => args.tokens.clone(),
1793-
AttrArgs::Eq { expr, .. } => TokenStream::from_ast(expr.unwrap_ast()),
1793+
AttrArgs::Eq { expr, .. } => TokenStream::from_ast(expr),
17941794
}
17951795
}
17961796
}
@@ -1804,13 +1804,9 @@ where
18041804
match self {
18051805
AttrArgs::Empty => {}
18061806
AttrArgs::Delimited(args) => args.hash_stable(ctx, hasher),
1807-
AttrArgs::Eq { expr: AttrArgsEq::Ast(expr), .. } => {
1807+
AttrArgs::Eq { expr, .. } => {
18081808
unreachable!("hash_stable {:?}", expr);
18091809
}
1810-
AttrArgs::Eq { eq_span, expr: AttrArgsEq::Hir(lit) } => {
1811-
eq_span.hash_stable(ctx, hasher);
1812-
lit.hash_stable(ctx, hasher);
1813-
}
18141810
}
18151811
}
18161812
}

0 commit comments

Comments
 (0)