Skip to content

Commit 5409a40

Browse files
committed
Implement rpc protocol changes
1 parent c26d5f5 commit 5409a40

File tree

13 files changed

+401
-82
lines changed

13 files changed

+401
-82
lines changed

Cargo.lock

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

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)