diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-07-25 01:29:02 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-10-17 00:58:44 -0500 |
commit | 0f5207bac6c6280ecf6d9910ddfb04f35cec6244 (patch) | |
tree | 099423a1edaf962cc0a6023901a59cdc8234ed63 /bootstrap/rust-1.62/0040-rls-atomics.patch | |
parent | 3bb402800fd7e4c05da8348662c5c0a57bbadec6 (diff) | |
download | packages-0f5207bac6c6280ecf6d9910ddfb04f35cec6244.tar.gz packages-0f5207bac6c6280ecf6d9910ddfb04f35cec6244.tar.bz2 packages-0f5207bac6c6280ecf6d9910ddfb04f35cec6244.tar.xz packages-0f5207bac6c6280ecf6d9910ddfb04f35cec6244.zip |
bootstrap/rust-1.62: New package
Diffstat (limited to 'bootstrap/rust-1.62/0040-rls-atomics.patch')
-rw-r--r-- | bootstrap/rust-1.62/0040-rls-atomics.patch | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/bootstrap/rust-1.62/0040-rls-atomics.patch b/bootstrap/rust-1.62/0040-rls-atomics.patch new file mode 100644 index 000000000..e084217ba --- /dev/null +++ b/bootstrap/rust-1.62/0040-rls-atomics.patch @@ -0,0 +1,58 @@ +--- rustc-1.58.1-src/src/tools/rls/rls/src/cmd.rs ++++ rustc-1.58.1-src/src/tools/rls/rls/src/cmd.rs +@@ -7,7 +7,7 @@ use crate::config::Config; + use crate::server::{self, LsService, Notification, Request, RequestId}; + use rls_analysis::{AnalysisHost, Target}; + use rls_vfs::Vfs; +-use std::sync::atomic::{AtomicU64, Ordering}; ++use std::sync::atomic::{AtomicU32, Ordering}; + + use lsp_types::{ + ClientCapabilities, CodeActionContext, CodeActionParams, CompletionItem, +@@ -316,8 +316,8 @@ fn url(file_name: &str) -> Url { + } + + fn next_id() -> RequestId { +- static ID: AtomicU64 = AtomicU64::new(1); +- RequestId::Num(ID.fetch_add(1, Ordering::SeqCst)) ++ static ID: AtomicU32 = AtomicU32::new(1); ++ RequestId::Num(ID.fetch_add(1, Ordering::SeqCst).into()) + } + + // Custom reader and output for the RLS server. +--- rustc-1.58.1-src/src/tools/rls/rls/src/server/io.rs ++++ rustc-1.58.1-src/src/tools/rls/rls/src/server/io.rs +@@ -5,7 +5,7 @@ use crate::lsp_data::{LSPNotification, LSPRequest}; + + use std::fmt; + use std::io::{self, BufRead, Write}; +-use std::sync::atomic::{AtomicU64, Ordering}; ++use std::sync::atomic::{AtomicU32, Ordering}; + use std::sync::Arc; + + use jsonrpc_core::{self as jsonrpc, response, version, Id}; +@@ -169,13 +169,13 @@ pub trait Output: Sync + Send + Clone + 'static { + /// An output that sends notifications and responses on `stdout`. + #[derive(Clone)] + pub(super) struct StdioOutput { +- next_id: Arc<AtomicU64>, ++ next_id: Arc<AtomicU32>, + } + + impl StdioOutput { + /// Constructs a new `stdout` output. + pub(crate) fn new() -> StdioOutput { +- StdioOutput { next_id: Arc::new(AtomicU64::new(1)) } ++ StdioOutput { next_id: Arc::new(AtomicU32::new(1).into()) } + } + } + +@@ -192,7 +192,7 @@ impl Output for StdioOutput { + } + + fn provide_id(&self) -> RequestId { +- RequestId::Num(self.next_id.fetch_add(1, Ordering::SeqCst)) ++ RequestId::Num(self.next_id.fetch_add(1, Ordering::SeqCst).into()) + } + } + |