minor: Remove unneded allocation in proc-macro-srv-cli

This commit is contained in:
Lukas Wirth 2025-12-28 10:00:50 +01:00
parent 33ad9ca3bc
commit fa8649fccd
3 changed files with 4 additions and 6 deletions

View file

@ -3,7 +3,7 @@
use std::io::{self, BufRead, Write};
pub trait Framing {
type Buf: Default + Send;
type Buf: Default + Send + Sync;
fn read<'a, R: BufRead + ?Sized>(
inp: &mut R,

View file

@ -243,7 +243,7 @@ fn handle_expand_ra<C: Codec>(
def_site,
call_site,
mixed_site,
Some(Box::new(ProcMacroClientHandle::<C> { stdin, stdout, buf })),
Some(&mut ProcMacroClientHandle::<C> { stdin, stdout, buf }),
)
.map(|it| {
(

View file

@ -91,7 +91,7 @@ impl<'env> ProcMacroSrv<'env> {
}
}
pub type ProcMacroClientHandle<'a> = Box<dyn ProcMacroClientInterface + Send + 'a>;
pub type ProcMacroClientHandle<'a> = &'a mut (dyn ProcMacroClientInterface + Sync + Send);
pub trait ProcMacroClientInterface {
fn source_text(&mut self, file_id: u32, start: u32, end: u32) -> Option<String>;
@ -178,9 +178,7 @@ impl ProcMacroSrv<'_> {
}
pub trait ProcMacroSrvSpan: Copy + Send + Sync {
type Server<'a>: proc_macro::bridge::server::Server<TokenStream = crate::token_stream::TokenStream<Self>>
where
Self: 'a;
type Server<'a>: proc_macro::bridge::server::Server<TokenStream = crate::token_stream::TokenStream<Self>>;
fn make_server<'a>(
call_site: Self,
def_site: Self,