Skip to content

Commit 19e816d

Browse files
committed
change request id to u32 to make powerpc happy
1 parent 58f2e17 commit 19e816d

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::{
88
legacy_protocol::msg::{FlatTree, Message, PanicMessage, ServerConfig},
99
};
1010

11-
pub type RequestId = u64;
11+
pub type RequestId = u32;
1212

1313
#[derive(Debug, Serialize, Deserialize)]
1414
pub struct Envelope {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::{
66
process::{Child, ChildStdin, ChildStdout, Command, Stdio},
77
sync::{
88
Arc, Mutex, OnceLock,
9-
atomic::{AtomicU64, Ordering},
9+
atomic::{AtomicU32, Ordering},
1010
},
1111
};
1212

@@ -36,7 +36,7 @@ pub(crate) struct ProcMacroServerProcess {
3636
protocol: Protocol,
3737
/// Populated when the server exits.
3838
exited: OnceLock<AssertUnwindSafe<ServerError>>,
39-
next_request_id: AtomicU64,
39+
next_request_id: AtomicU32,
4040
}
4141

4242
#[derive(Debug, Clone)]
@@ -94,7 +94,7 @@ impl ProcMacroServerProcess {
9494
version: 0,
9595
protocol: protocol.clone(),
9696
exited: OnceLock::new(),
97-
next_request_id: AtomicU64::new(1),
97+
next_request_id: AtomicU32::new(1),
9898
})
9999
};
100100
let mut srv = create_srv()?;

crates/proc-macro-srv-cli/src/main_loop.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use proc_macro_api::{
1010
version::CURRENT_API_VERSION,
1111
};
1212

13+
use bidirectional::RequestId;
1314
use legacy::Message;
1415

1516
use proc_macro_srv::{EnvSnapshot, SpanId};
@@ -128,7 +129,7 @@ fn handle_expand<W: std::io::Write, R: std::io::BufRead, C: Codec>(
128129
stdin: &mut R,
129130
stdout: &mut W,
130131
buf: &mut C::Buf,
131-
req_id: u64,
132+
req_id: RequestId,
132133
span_mode: legacy::SpanMode,
133134
task: bidirectional::ExpandMacro,
134135
) -> io::Result<()> {
@@ -143,7 +144,7 @@ fn handle_expand<W: std::io::Write, R: std::io::BufRead, C: Codec>(
143144
fn handle_expand_id<W: std::io::Write, C: Codec>(
144145
srv: &proc_macro_srv::ProcMacroSrv<'_>,
145146
stdout: &mut W,
146-
req_id: u64,
147+
req_id: RequestId,
147148
task: bidirectional::ExpandMacro,
148149
) -> io::Result<()> {
149150
let bidirectional::ExpandMacro { lib, env, current_dir, data } = task;
@@ -189,7 +190,7 @@ fn handle_expand_ra<W: std::io::Write, R: std::io::BufRead, C: Codec>(
189190
stdin: &mut R,
190191
stdout: &mut W,
191192
buf: &mut C::Buf,
192-
req_id: u64,
193+
req_id: RequestId,
193194
task: bidirectional::ExpandMacro,
194195
) -> io::Result<()> {
195196
let bidirectional::ExpandMacro {
@@ -473,7 +474,7 @@ fn from_client_res(value: bidirectional::SubResponse) -> proc_macro_srv::SubResp
473474

474475
fn send_response<W: std::io::Write, C: Codec>(
475476
stdout: &mut W,
476-
id: u64,
477+
id: u32,
477478
resp: bidirectional::Response,
478479
) -> io::Result<()> {
479480
let resp = bidirectional::Envelope {
@@ -486,7 +487,7 @@ fn send_response<W: std::io::Write, C: Codec>(
486487

487488
fn send_subrequest<W: std::io::Write, C: Codec>(
488489
stdout: &mut W,
489-
id: u64,
490+
id: u32,
490491
resp: bidirectional::SubRequest,
491492
) -> io::Result<()> {
492493
let resp = bidirectional::Envelope {

0 commit comments

Comments
 (0)