diff --git a/Cargo.lock b/Cargo.lock index 1948e6c2e5ef6..5093b097fc3c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3797,7 +3797,6 @@ dependencies = [ name = "rustc_expand" version = "0.0.0" dependencies = [ - "crossbeam-channel", "rustc_ast", "rustc_ast_passes", "rustc_ast_pretty", diff --git a/compiler/rustc_expand/Cargo.toml b/compiler/rustc_expand/Cargo.toml index 9189a501aa5f4..63247f9d0519c 100644 --- a/compiler/rustc_expand/Cargo.toml +++ b/compiler/rustc_expand/Cargo.toml @@ -9,7 +9,6 @@ doctest = false [dependencies] # tidy-alphabetical-start -crossbeam-channel = "0.5.0" rustc_ast = { path = "../rustc_ast" } rustc_ast_passes = { path = "../rustc_ast_passes" } rustc_ast_pretty = { path = "../rustc_ast_pretty" } diff --git a/compiler/rustc_expand/src/proc_macro.rs b/compiler/rustc_expand/src/proc_macro.rs index 73a7d433b5c68..448e7bfd73281 100644 --- a/compiler/rustc_expand/src/proc_macro.rs +++ b/compiler/rustc_expand/src/proc_macro.rs @@ -13,16 +13,16 @@ use rustc_session::config::ProcMacroExecutionStrategy; use rustc_span::profiling::SpannedEventArgRecorder; use rustc_span::{Span, DUMMY_SP}; -struct CrossbeamMessagePipe { - tx: crossbeam_channel::Sender, - rx: crossbeam_channel::Receiver, +struct MessagePipe { + tx: std::sync::mpsc::SyncSender, + rx: std::sync::mpsc::Receiver, } -impl pm::bridge::server::MessagePipe for CrossbeamMessagePipe { +impl pm::bridge::server::MessagePipe for MessagePipe { fn new() -> (Self, Self) { - let (tx1, rx1) = crossbeam_channel::bounded(1); - let (tx2, rx2) = crossbeam_channel::bounded(1); - (CrossbeamMessagePipe { tx: tx1, rx: rx2 }, CrossbeamMessagePipe { tx: tx2, rx: rx1 }) + let (tx1, rx1) = std::sync::mpsc::sync_channel(1); + let (tx2, rx2) = std::sync::mpsc::sync_channel(1); + (MessagePipe { tx: tx1, rx: rx2 }, MessagePipe { tx: tx2, rx: rx1 }) } fn send(&mut self, value: T) { @@ -35,7 +35,7 @@ impl pm::bridge::server::MessagePipe for CrossbeamMessagePipe { } fn exec_strategy(ecx: &ExtCtxt<'_>) -> impl pm::bridge::server::ExecutionStrategy { - pm::bridge::server::MaybeCrossThread::>::new( + pm::bridge::server::MaybeCrossThread::>::new( ecx.sess.opts.unstable_opts.proc_macro_execution_strategy == ProcMacroExecutionStrategy::CrossThread, )