Unnamed repository; edit this file 'description' to name the repository.
change request id to u32 to make powerpc happy
| -rw-r--r-- | crates/proc-macro-api/src/bidirectional_protocol/msg.rs | 2 | ||||
| -rw-r--r-- | crates/proc-macro-api/src/process.rs | 6 | ||||
| -rw-r--r-- | crates/proc-macro-srv-cli/src/main_loop.rs | 11 |
3 files changed, 10 insertions, 9 deletions
diff --git a/crates/proc-macro-api/src/bidirectional_protocol/msg.rs b/crates/proc-macro-api/src/bidirectional_protocol/msg.rs index 7aed3ae1e6..796573385c 100644 --- a/crates/proc-macro-api/src/bidirectional_protocol/msg.rs +++ b/crates/proc-macro-api/src/bidirectional_protocol/msg.rs @@ -8,7 +8,7 @@ use crate::{ legacy_protocol::msg::{FlatTree, Message, PanicMessage, ServerConfig}, }; -pub type RequestId = u64; +pub type RequestId = u32; #[derive(Debug, Serialize, Deserialize)] pub struct Envelope { diff --git a/crates/proc-macro-api/src/process.rs b/crates/proc-macro-api/src/process.rs index 723fc928ff..bb4599c532 100644 --- a/crates/proc-macro-api/src/process.rs +++ b/crates/proc-macro-api/src/process.rs @@ -6,7 +6,7 @@ use std::{ process::{Child, ChildStdin, ChildStdout, Command, Stdio}, sync::{ Arc, Mutex, OnceLock, - atomic::{AtomicU64, Ordering}, + atomic::{AtomicU32, Ordering}, }, }; @@ -36,7 +36,7 @@ pub(crate) struct ProcMacroServerProcess { protocol: Protocol, /// Populated when the server exits. exited: OnceLock<AssertUnwindSafe<ServerError>>, - next_request_id: AtomicU64, + next_request_id: AtomicU32, } #[derive(Debug, Clone)] @@ -94,7 +94,7 @@ impl ProcMacroServerProcess { version: 0, protocol: protocol.clone(), exited: OnceLock::new(), - next_request_id: AtomicU64::new(1), + next_request_id: AtomicU32::new(1), }) }; let mut srv = create_srv()?; diff --git a/crates/proc-macro-srv-cli/src/main_loop.rs b/crates/proc-macro-srv-cli/src/main_loop.rs index 1ad73d4daa..dc828a87de 100644 --- a/crates/proc-macro-srv-cli/src/main_loop.rs +++ b/crates/proc-macro-srv-cli/src/main_loop.rs @@ -10,6 +10,7 @@ use proc_macro_api::{ version::CURRENT_API_VERSION, }; +use bidirectional::RequestId; use legacy::Message; use proc_macro_srv::{EnvSnapshot, SpanId}; @@ -128,7 +129,7 @@ fn handle_expand<W: std::io::Write, R: std::io::BufRead, C: Codec>( stdin: &mut R, stdout: &mut W, buf: &mut C::Buf, - req_id: u64, + req_id: RequestId, span_mode: legacy::SpanMode, task: bidirectional::ExpandMacro, ) -> io::Result<()> { @@ -143,7 +144,7 @@ fn handle_expand<W: std::io::Write, R: std::io::BufRead, C: Codec>( fn handle_expand_id<W: std::io::Write, C: Codec>( srv: &proc_macro_srv::ProcMacroSrv<'_>, stdout: &mut W, - req_id: u64, + req_id: RequestId, task: bidirectional::ExpandMacro, ) -> io::Result<()> { 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>( stdin: &mut R, stdout: &mut W, buf: &mut C::Buf, - req_id: u64, + req_id: RequestId, task: bidirectional::ExpandMacro, ) -> io::Result<()> { let bidirectional::ExpandMacro { @@ -473,7 +474,7 @@ fn from_client_res(value: bidirectional::SubResponse) -> proc_macro_srv::SubResp fn send_response<W: std::io::Write, C: Codec>( stdout: &mut W, - id: u64, + id: u32, resp: bidirectional::Response, ) -> io::Result<()> { let resp = bidirectional::Envelope { @@ -486,7 +487,7 @@ fn send_response<W: std::io::Write, C: Codec>( fn send_subrequest<W: std::io::Write, C: Codec>( stdout: &mut W, - id: u64, + id: u32, resp: bidirectional::SubRequest, ) -> io::Result<()> { let resp = bidirectional::Envelope { |