Skip to content

Commit 96d23cb

Browse files
committed
Add hir::Attribute
1 parent 75507ad commit 96d23cb

File tree

89 files changed

+1145
-660
lines changed

Some content is hidden

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

89 files changed

+1145
-660
lines changed

Cargo.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3522,6 +3522,7 @@ dependencies = [
35223522
"rustc_fluent_macro",
35233523
"rustc_fs_util",
35243524
"rustc_hir",
3525+
"rustc_hir_pretty",
35253526
"rustc_incremental",
35263527
"rustc_index",
35273528
"rustc_macros",
@@ -3787,6 +3788,7 @@ dependencies = [
37873788
"rustc_span",
37883789
"rustc_target",
37893790
"smallvec",
3791+
"thin-vec",
37903792
"tracing",
37913793
]
37923794

@@ -4455,9 +4457,9 @@ version = "0.0.0"
44554457
dependencies = [
44564458
"rustc_abi",
44574459
"rustc_ast",
4458-
"rustc_ast_pretty",
44594460
"rustc_data_structures",
44604461
"rustc_hir",
4462+
"rustc_hir_pretty",
44614463
"rustc_middle",
44624464
"rustc_session",
44634465
"rustc_span",

compiler/rustc_ast/src/ast.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,7 @@ pub enum AttrArgs {
17401740
/// Span of the `=` token.
17411741
eq_span: Span,
17421742

1743-
expr: AttrArgsEq,
1743+
expr: P<Expr>,
17441744
},
17451745
}
17461746

@@ -1785,7 +1785,7 @@ impl AttrArgs {
17851785
match self {
17861786
AttrArgs::Empty => None,
17871787
AttrArgs::Delimited(args) => Some(args.dspan.entire()),
1788-
AttrArgs::Eq { eq_span, expr } => Some(eq_span.to(expr.span())),
1788+
AttrArgs::Eq { eq_span, expr } => Some(eq_span.to(expr.span)),
17891789
}
17901790
}
17911791

@@ -1795,7 +1795,7 @@ impl AttrArgs {
17951795
match self {
17961796
AttrArgs::Empty => TokenStream::default(),
17971797
AttrArgs::Delimited(args) => args.tokens.clone(),
1798-
AttrArgs::Eq { expr, .. } => TokenStream::from_ast(expr.unwrap_ast()),
1798+
AttrArgs::Eq { expr, .. } => TokenStream::from_ast(expr),
17991799
}
18001800
}
18011801
}
@@ -1809,13 +1809,9 @@ where
18091809
match self {
18101810
AttrArgs::Empty => {}
18111811
AttrArgs::Delimited(args) => args.hash_stable(ctx, hasher),
1812-
AttrArgs::Eq { expr: AttrArgsEq::Ast(expr), .. } => {
1812+
AttrArgs::Eq { expr, .. } => {
18131813
unreachable!("hash_stable {:?}", expr);
18141814
}
1815-
AttrArgs::Eq { eq_span, expr: AttrArgsEq::Hir(lit) } => {
1816-
eq_span.hash_stable(ctx, hasher);
1817-
lit.hash_stable(ctx, hasher);
1818-
}
18191815
}
18201816
}
18211817
}

0 commit comments

Comments
 (0)