Merge pull request #21352 from Veykril/push-knwlqypxtukr
minor: Remove unneeded allocation in proc-macro-srv-cli
This commit is contained in:
commit
5a119a5780
3 changed files with 4 additions and 6 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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| {
|
||||
(
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue