Update Rust toolchain to 1.89 (#19807)

This commit is contained in:
Micha Reiser 2025-08-07 18:21:50 +02:00 committed by GitHub
parent b22586fa0e
commit 7dfde3b929
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
101 changed files with 234 additions and 200 deletions

View file

@ -33,7 +33,7 @@ use super::{Result, schedule::BackgroundSchedule};
/// that is of type [`lsp_types::Url`].
macro_rules! define_document_url {
($params:ident: &$p:ty) => {
fn document_url($params: &$p) -> std::borrow::Cow<lsp_types::Url> {
fn document_url($params: &$p) -> std::borrow::Cow<'_, lsp_types::Url> {
std::borrow::Cow::Borrowed(&$params.text_document.uri)
}
};

View file

@ -21,7 +21,7 @@ impl super::RequestHandler for CodeActionResolve {
}
impl super::BackgroundDocumentRequestHandler for CodeActionResolve {
fn document_url(params: &types::CodeAction) -> Cow<types::Url> {
fn document_url(params: &types::CodeAction) -> Cow<'_, types::Url> {
let uri: lsp_types::Url = serde_json::from_value(params.data.clone().unwrap_or_default())
.expect("code actions should have a URI in their data fields");
Cow::Owned(uri)

View file

@ -15,7 +15,7 @@ impl super::RequestHandler for Hover {
}
impl super::BackgroundDocumentRequestHandler for Hover {
fn document_url(params: &types::HoverParams) -> std::borrow::Cow<lsp_types::Url> {
fn document_url(params: &types::HoverParams) -> std::borrow::Cow<'_, lsp_types::Url> {
std::borrow::Cow::Borrowed(&params.text_document_position_params.text_document.uri)
}
fn run_with_snapshot(

View file

@ -62,7 +62,7 @@ pub(super) trait BackgroundDocumentRequestHandler: RequestHandler {
/// [`define_document_url`]: super::define_document_url
fn document_url(
params: &<<Self as RequestHandler>::RequestType as Request>::Params,
) -> std::borrow::Cow<lsp_types::Url>;
) -> std::borrow::Cow<'_, lsp_types::Url>;
fn run_with_snapshot(
snapshot: DocumentSnapshot,
@ -100,7 +100,7 @@ pub(super) trait BackgroundDocumentNotificationHandler: NotificationHandler {
/// [`define_document_url`]: super::define_document_url
fn document_url(
params: &<<Self as NotificationHandler>::NotificationType as LSPNotification>::Params,
) -> std::borrow::Cow<lsp_types::Url>;
) -> std::borrow::Cow<'_, lsp_types::Url>;
fn run_with_snapshot(
snapshot: DocumentSnapshot,

View file

@ -619,7 +619,7 @@ impl DocumentQuery {
/// Get the path for the document selected by this query, ignoring whether the file exists on disk.
///
/// Returns the URL's path if this is an unsaved (untitled) document.
pub(crate) fn virtual_file_path(&self) -> Cow<Path> {
pub(crate) fn virtual_file_path(&self) -> Cow<'_, Path> {
self.file_path()
.map(Cow::Owned)
.unwrap_or_else(|| Cow::Borrowed(Path::new(self.file_url().path())))