Skip to content

Commit cf4b1fa

Browse files
authored
Merge pull request #21097 from Veykril/push-zpqupukpkrts
proc-macro-srv: Reimplement token trees via immutable trees
2 parents 55ee7ec + 9b767f3 commit cf4b1fa

File tree

33 files changed

+1647
-1190
lines changed

33 files changed

+1647
-1190
lines changed

Cargo.lock

Lines changed: 1 addition & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/hir-def/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ tracing = { workspace = true, features = ["attributes"] }
2727
smallvec.workspace = true
2828
triomphe.workspace = true
2929
rustc_apfloat = "0.2.3"
30-
text-size.workspace = true
3130
salsa.workspace = true
3231
salsa-macros.workspace = true
3332
query-group.workspace = true

crates/hir-ty/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ doctest = false
1616
cov-mark = "2.0.0"
1717
itertools.workspace = true
1818
arrayvec.workspace = true
19-
bitflags.workspace = true
2019
smallvec.workspace = true
2120
ena = "0.14.3"
2221
either.workspace = true
2322
oorandom = "11.1.5"
2423
tracing = { workspace = true, features = ["attributes"] }
2524
rustc-hash.workspace = true
26-
scoped-tls = "1.0.1"
2725
la-arena.workspace = true
2826
triomphe.workspace = true
2927
typed-arena = "2.0.2"

crates/hir/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ itertools.workspace = true
2020
smallvec.workspace = true
2121
tracing = { workspace = true, features = ["attributes"] }
2222
triomphe.workspace = true
23-
indexmap.workspace = true
2423

2524
ra-ap-rustc_type_ir.workspace = true
2625

crates/ide-db/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ rustc-hash.workspace = true
2222
either.workspace = true
2323
itertools.workspace = true
2424
arrayvec.workspace = true
25-
indexmap.workspace = true
2625
memchr = "2.7.5"
2726
salsa.workspace = true
2827
salsa-macros.workspace = true

crates/proc-macro-api/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@ indexmap.workspace = true
2424
paths = { workspace = true, features = ["serde1"] }
2525
tt.workspace = true
2626
stdx.workspace = true
27+
proc-macro-srv = {workspace = true, optional = true}
2728
# span = {workspace = true, default-features = false} does not work
2829
span = { path = "../span", version = "0.0.0", default-features = false}
2930

3031
intern.workspace = true
3132

33+
[features]
34+
sysroot-abi = ["proc-macro-srv", "proc-macro-srv/sysroot-abi"]
35+
3236
[lints]
3337
workspace = true

crates/proc-macro-api/src/legacy_protocol.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ pub(crate) fn expand(
9595
let mixed_site = span_data_table.insert_full(mixed_site).0;
9696
let task = ExpandMacro {
9797
data: ExpandMacroData {
98-
macro_body: FlatTree::new(subtree, version, &mut span_data_table),
98+
macro_body: FlatTree::from_subtree(subtree, version, &mut span_data_table),
9999
macro_name: proc_macro.name.to_string(),
100-
attributes: attr.map(|subtree| FlatTree::new(subtree, version, &mut span_data_table)),
100+
attributes: attr
101+
.map(|subtree| FlatTree::from_subtree(subtree, version, &mut span_data_table)),
101102
has_global_spans: ExpnGlobals {
102103
serialize: version >= version::HAS_GLOBAL_SPANS,
103104
def_site,

crates/proc-macro-api/src/legacy_protocol/msg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ mod tests {
297297
let mut span_data_table = Default::default();
298298
let task = ExpandMacro {
299299
data: ExpandMacroData {
300-
macro_body: FlatTree::new(tt.view(), v, &mut span_data_table),
300+
macro_body: FlatTree::from_subtree(tt.view(), v, &mut span_data_table),
301301
macro_name: Default::default(),
302302
attributes: None,
303303
has_global_spans: ExpnGlobals {

0 commit comments

Comments
 (0)