chore: Prepare for Rust edition bump to 2024 (without autofix) (#27791)

Successor to #27779 - in this PR I've applied changes manually, without
futzing with if let lifetimes at all.

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz
2025-03-31 20:10:36 +02:00
committed by GitHub
parent d51aa2ffb0
commit 0729d24d77
162 changed files with 2333 additions and 1937 deletions
+1 -1
View File
@@ -566,7 +566,7 @@ impl DapStore {
.ok(),
cx,
)
})
});
}
}
+1 -1
View File
@@ -25,7 +25,7 @@ impl LocatorStore {
&self,
debug_config: &mut DebugAdapterConfig,
) -> Result<()> {
let Some(ref locator_name) = &debug_config.locator else {
let Some(locator_name) = &debug_config.locator else {
log::debug!("Attempted to resolve debug config without a locator field");
return Ok(());
};
+3 -1
View File
@@ -342,7 +342,9 @@ async fn load_shell_environment(
.await
.log_err()
else {
return message("Failed to spawn login shell to source login environment variables. See logs for details");
return message(
"Failed to spawn login shell to source login environment variables. See logs for details",
);
};
if !output.status.success() {
+1 -1
View File
@@ -1136,7 +1136,7 @@ impl GitStore {
&mut self,
buffers: Vec<Entity<Buffer>>,
cx: &mut Context<Self>,
) -> impl Future<Output = ()> {
) -> impl Future<Output = ()> + use<> {
let mut futures = Vec::new();
for buffer in buffers {
if let Some(diff_state) = self.diffs.get_mut(&buffer.read(cx).remote_id()) {
+15 -12
View File
@@ -974,7 +974,7 @@ impl LocalLspStore {
fn shutdown_language_servers(
&mut self,
_cx: &mut Context<LspStore>,
) -> impl Future<Output = ()> {
) -> impl Future<Output = ()> + use<> {
let shutdown_futures = self
.language_servers
.drain()
@@ -2564,7 +2564,10 @@ impl LocalLspStore {
}
})?;
} else {
log::warn!("Cannot execute a command {} not listed in the language server capabilities", command.command)
log::warn!(
"Cannot execute a command {} not listed in the language server capabilities",
command.command
)
}
}
}
@@ -3230,16 +3233,16 @@ impl LocalLspStore {
if registrations.remove(registration_id).is_some() {
log::info!(
"language server {}: unregistered workspace/DidChangeWatchedFiles capability with id {}",
language_server_id,
registration_id
);
"language server {}: unregistered workspace/DidChangeWatchedFiles capability with id {}",
language_server_id,
registration_id
);
} else {
log::warn!(
"language server {}: failed to unregister workspace/DidChangeWatchedFiles capability with id {}. not registered.",
language_server_id,
registration_id
);
"language server {}: failed to unregister workspace/DidChangeWatchedFiles capability with id {}. not registered.",
language_server_id,
registration_id
);
}
self.rebuild_watched_paths(language_server_id, cx);
@@ -3558,7 +3561,7 @@ impl LspStore {
toolchain_store: Some(toolchain_store),
languages: languages.clone(),
language_server_statuses: Default::default(),
nonce: StdRng::from_entropy().gen(),
nonce: StdRng::from_entropy().r#gen(),
diagnostic_summaries: Default::default(),
active_entry: None,
@@ -3614,7 +3617,7 @@ impl LspStore {
worktree_store,
languages: languages.clone(),
language_server_statuses: Default::default(),
nonce: StdRng::from_entropy().gen(),
nonce: StdRng::from_entropy().r#gen(),
diagnostic_summaries: Default::default(),
active_entry: None,
toolchain_store,
+1 -1
View File
@@ -4595,7 +4595,7 @@ impl Project {
ProjectClientState::Shared { .. } | ProjectClientState::Local => {
return Task::ready(Err(anyhow!(
"can't synchronize remote buffers on a local project"
)))
)));
}
};
+21 -19
View File
@@ -4772,12 +4772,11 @@ async fn test_search_with_inclusions(cx: &mut gpui::TestAppContext) {
false,
true,
false,
PathMatcher::new(&["*.ts".to_owned(), "*.odd".to_owned()]).unwrap(),
PathMatcher::new(&["*.ts".to_owned(), "*.odd".to_owned()]).unwrap(),
Default::default(),
None,
).unwrap(),
)
.unwrap(),
cx
)
.await
@@ -4797,12 +4796,12 @@ async fn test_search_with_inclusions(cx: &mut gpui::TestAppContext) {
false,
true,
false,
PathMatcher::new(&["*.rs".to_owned(), "*.ts".to_owned(), "*.odd".to_owned()]).unwrap(),
Default::default(),
None,
).unwrap(),
PathMatcher::new(&["*.rs".to_owned(), "*.ts".to_owned(), "*.odd".to_owned()])
.unwrap(),
Default::default(),
None,
)
.unwrap(),
cx
)
.await
@@ -4897,7 +4896,8 @@ async fn test_search_with_exclusions(cx: &mut gpui::TestAppContext) {
Default::default(),
PathMatcher::new(&["*.ts".to_owned(), "*.odd".to_owned()]).unwrap(),
None,
).unwrap(),
)
.unwrap(),
cx
)
.await
@@ -4917,16 +4917,17 @@ async fn test_search_with_exclusions(cx: &mut gpui::TestAppContext) {
false,
true,
false,
Default::default(),
PathMatcher::new(&["*.rs".to_owned(), "*.ts".to_owned(), "*.odd".to_owned()]).unwrap(),
None,
).unwrap(),
Default::default(),
PathMatcher::new(&["*.rs".to_owned(), "*.ts".to_owned(), "*.odd".to_owned()])
.unwrap(),
None,
)
.unwrap(),
cx
)
.await
.unwrap().is_empty(),
.unwrap()
.is_empty(),
"Rust and typescript exclusion should give no files, even if other exclusions don't match anything"
);
}
@@ -4982,7 +4983,8 @@ async fn test_search_with_exclusions_and_inclusions(cx: &mut gpui::TestAppContex
PathMatcher::new(&["*.ts".to_owned()]).unwrap(),
PathMatcher::new(&["*.ts".to_owned()]).unwrap(),
None,
).unwrap(),
)
.unwrap(),
cx
)
.await
+1 -1
View File
@@ -392,7 +392,7 @@ impl Inventory {
}
},
message: format!("Failed to parse tasks file content as a JSON array: {e}"),
})
});
}
};
let new_templates = raw_tasks