Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
chore: Bump Rust to 1.87 (#30739)
Piotr Osiewicz0f17e821545c
diff --git a/Cargo.toml b/Cargo.tomlindex 97c076eb89d..5e31225c6c2 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -788,6 +788,9 @@ let_underscore_future = "allow"# running afoul of the borrow checker.too_many_arguments = "allow"+# We often have large enum variants yet we rarely actually bother with splitting them up.+large_enum_variant = "allow"+[workspace.metadata.cargo-machete]ignored = ["bindgen",diff --git a/Dockerfile-collab b/Dockerfile-collabindex 3c622d8fe1a..48854af4dad 100644--- a/Dockerfile-collab+++ b/Dockerfile-collab@@ -1,6 +1,6 @@# syntax = docker/dockerfile:1.2-FROM rust:1.86-bookworm as builder+FROM rust:1.87-bookworm as builderWORKDIR appCOPY . .diff --git a/crates/agent/src/agent_configuration/configure_context_server_modal.rs b/crates/agent/src/agent_configuration/configure_context_server_modal.rsindex 29c14d2662f..c916e7dc323 100644--- a/crates/agent/src/agent_configuration/configure_context_server_modal.rs+++ b/crates/agent/src/agent_configuration/configure_context_server_modal.rs@@ -30,7 +30,6 @@ pub(crate) struct ConfigureContextServerModal {context_server_store: Entity<ContextServerStore>,}-#[allow(clippy::large_enum_variant)]enum Configuration {NotAvailable,Required(ConfigurationRequiredState),diff --git a/crates/assistant_tools/src/edit_agent/evals/fixtures/disable_cursor_blinking/before.rs b/crates/assistant_tools/src/edit_agent/evals/fixtures/disable_cursor_blinking/before.rsindex afd47ed300f..1204960463d 100644--- a/crates/assistant_tools/src/edit_agent/evals/fixtures/disable_cursor_blinking/before.rs+++ b/crates/assistant_tools/src/edit_agent/evals/fixtures/disable_cursor_blinking/before.rs@@ -1249,7 +1249,7 @@ pub struct ActiveDiagnosticGroup {}#[derive(Debug, PartialEq, Eq)]-#[allow(clippy::large_enum_variant)]+pub(crate) enum ActiveDiagnostic {None,All,diff --git a/crates/collab/src/db.rs b/crates/collab/src/db.rsindex 04b65476922..9034f608929 100644--- a/crates/collab/src/db.rs+++ b/crates/collab/src/db.rs@@ -543,7 +543,7 @@ pub struct MembershipUpdated {/// The result of setting a member's role.#[derive(Debug)]-#[allow(clippy::large_enum_variant)]+pub enum SetMemberRoleResult {InviteUpdated(Channel),MembershipUpdated(MembershipUpdated),diff --git a/crates/collab/src/main.rs b/crates/collab/src/main.rsindex e5240666c4b..f2dbf175870 100644--- a/crates/collab/src/main.rs+++ b/crates/collab/src/main.rs@@ -36,6 +36,7 @@ use util::{ResultExt as _, maybe};const VERSION: &str = env!("CARGO_PKG_VERSION");const REVISION: Option<&'static str> = option_env!("GITHUB_SHA");+#[expect(clippy::result_large_err)]#[tokio::main]async fn main() -> Result<()> {if let Err(error) = env::load_dotenv() {diff --git a/crates/collab/src/tests.rs b/crates/collab/src/tests.rsindex 5a9af2a622b..6ddb349700d 100644--- a/crates/collab/src/tests.rs+++ b/crates/collab/src/tests.rs@@ -36,8 +36,8 @@ fn room_participants(room: &Entity<Room>, cx: &mut TestAppContext) -> RoomParticroom.read_with(cx, |room, _| {let mut remote = room.remote_participants()- .iter()- .map(|(_, participant)| participant.user.github_login.clone())+ .values()+ .map(|participant| participant.user.github_login.clone()).collect::<Vec<_>>();let mut pending = room.pending_participants()diff --git a/crates/debugger_ui/src/session/running/stack_frame_list.rs b/crates/debugger_ui/src/session/running/stack_frame_list.rsindex ba0f42e52a6..efa2dbae630 100644--- a/crates/debugger_ui/src/session/running/stack_frame_list.rs+++ b/crates/debugger_ui/src/session/running/stack_frame_list.rs@@ -39,7 +39,6 @@ pub struct StackFrameList {_refresh_task: Task<()>,}-#[allow(clippy::large_enum_variant)]#[derive(Debug, PartialEq, Eq)]pub enum StackFrameEntry {Normal(dap::StackFrame),diff --git a/crates/editor/src/code_context_menus.rs b/crates/editor/src/code_context_menus.rsindex 858d055c874..74498c55b8a 100644--- a/crates/editor/src/code_context_menus.rs+++ b/crates/editor/src/code_context_menus.rs@@ -40,7 +40,6 @@ pub const MENU_ASIDE_X_PADDING: Pixels = px(16.);pub const MENU_ASIDE_MIN_WIDTH: Pixels = px(260.);pub const MENU_ASIDE_MAX_WIDTH: Pixels = px(500.);-#[allow(clippy::large_enum_variant)]pub enum CodeContextMenu {Completions(CompletionsMenu),CodeActions(CodeActionsMenu),@@ -928,7 +927,6 @@ impl CodeActionContents {}}-#[allow(clippy::large_enum_variant)]#[derive(Clone)]pub enum CodeActionsItem {Task(TaskSourceKind, ResolvedTask),diff --git a/crates/editor/src/display_map/block_map.rs b/crates/editor/src/display_map/block_map.rsindex c6422ae7411..8214ab7a8c0 100644--- a/crates/editor/src/display_map/block_map.rs+++ b/crates/editor/src/display_map/block_map.rs@@ -282,7 +282,6 @@ struct Transform {block: Option<Block>,}-#[allow(clippy::large_enum_variant)]#[derive(Clone)]pub enum Block {Custom(Arc<CustomBlock>),diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rsindex ec182c1167d..da7389f4aa6 100644--- a/crates/editor/src/editor.rs+++ b/crates/editor/src/editor.rs@@ -1311,7 +1311,7 @@ pub struct ActiveDiagnosticGroup {}#[derive(Debug, PartialEq, Eq)]-#[allow(clippy::large_enum_variant)]+pub(crate) enum ActiveDiagnostic {None,All,@@ -20278,8 +20278,8 @@ impl EditorSnapshot {let participant_indices = collaboration_hub.user_participant_indices(cx);let collaborators_by_peer_id = collaboration_hub.collaborators(cx);let collaborators_by_replica_id = collaborators_by_peer_id- .iter()- .map(|(_, collaborator)| (collaborator.replica_id, collaborator))+ .values()+ .map(|collaborator| (collaborator.replica_id, collaborator)).collect::<HashMap<_, _>>();self.buffer_snapshot.selections_in_range(range, false)diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rsindex 19c2ce311f6..b601984ea72 100644--- a/crates/editor/src/element.rs+++ b/crates/editor/src/element.rs@@ -6393,7 +6393,6 @@ pub(crate) struct LineWithInvisibles {font_size: Pixels,}-#[allow(clippy::large_enum_variant)]enum LineFragment {Text(ShapedLine),Element {diff --git a/crates/gpui/src/platform/linux/x11/clipboard.rs b/crates/gpui/src/platform/linux/x11/clipboard.rsindex 7817ee91770..497794bb118 100644--- a/crates/gpui/src/platform/linux/x11/clipboard.rs+++ b/crates/gpui/src/platform/linux/x11/clipboard.rs@@ -983,7 +983,7 @@ impl Clipboard {// format that the contents can be converted toformat_atoms[0..IMAGE_FORMAT_COUNT].copy_from_slice(&image_format_atoms);format_atoms[IMAGE_FORMAT_COUNT..].copy_from_slice(&text_format_atoms);- debug_assert!(!format_atoms.iter().any(|&a| a == atom_none));+ debug_assert!(!format_atoms.contains(&atom_none));let result = self.inner.read(&format_atoms, selection)?;diff --git a/crates/language/src/language.rs b/crates/language/src/language.rsindex dd89f7e78ae..1cb82be1ef4 100644--- a/crates/language/src/language.rs+++ b/crates/language/src/language.rs@@ -1858,9 +1858,9 @@ impl LanguageScope {pub fn language_allowed(&self, name: &LanguageServerName) -> bool {let config = &self.language.config;let opt_in_servers = &config.scope_opt_in_language_servers;- if opt_in_servers.iter().any(|o| *o == *name) {+ if opt_in_servers.contains(name) {if let Some(over) = self.config_override() {- over.opt_into_language_servers.iter().any(|o| *o == *name)+ over.opt_into_language_servers.contains(name)} else {false}diff --git a/crates/outline_panel/src/outline_panel.rs b/crates/outline_panel/src/outline_panel.rsindex b577408f067..de3af65d586 100644--- a/crates/outline_panel/src/outline_panel.rs+++ b/crates/outline_panel/src/outline_panel.rs@@ -1620,7 +1620,7 @@ impl OutlinePanel {.get(&external_file.buffer_id).into_iter().flat_map(|excerpts| {- excerpts.iter().map(|(excerpt_id, _)| {+ excerpts.keys().map(|excerpt_id| {CollapsedEntry::Excerpt(external_file.buffer_id,*excerpt_id,@@ -1641,7 +1641,7 @@ impl OutlinePanel {entries.extend(self.excerpts.get(&file.buffer_id).into_iter().flat_map(|excerpts| {- excerpts.iter().map(|(excerpt_id, _)| {+ excerpts.keys().map(|excerpt_id| {CollapsedEntry::Excerpt(file.buffer_id, *excerpt_id)})},diff --git a/crates/project/src/debugger/dap_store.rs b/crates/project/src/debugger/dap_store.rsindex ff20de4d3c2..848e13a2936 100644--- a/crates/project/src/debugger/dap_store.rs+++ b/crates/project/src/debugger/dap_store.rs@@ -64,7 +64,6 @@ pub enum DapStoreEvent {RemoteHasInitialized,}-#[allow(clippy::large_enum_variant)]enum DapStoreMode {Local(LocalDapStore),Ssh(SshDapStore),diff --git a/crates/project/src/lsp_store.rs b/crates/project/src/lsp_store.rsindex fa7169906f6..c182b8490d2 100644--- a/crates/project/src/lsp_store.rs+++ b/crates/project/src/lsp_store.rs@@ -3415,7 +3415,6 @@ pub struct RemoteLspStore {upstream_project_id: u64,}-#[allow(clippy::large_enum_variant)]pub(crate) enum LspStoreMode {Local(LocalLspStore), // ssh host and collab hostRemote(RemoteLspStore), // collab guest@@ -8806,9 +8805,10 @@ impl LspStore {})});- let is_unnecessary = diagnostic.tags.as_ref().map_or(false, |tags| {- tags.iter().any(|tag| *tag == DiagnosticTag::UNNECESSARY)- });+ let is_unnecessary = diagnostic+ .tags+ .as_ref()+ .map_or(false, |tags| tags.contains(&DiagnosticTag::UNNECESSARY));if is_supporting {supporting_diagnostics.insert(diff --git a/crates/project/src/manifest_tree/path_trie.rs b/crates/project/src/manifest_tree/path_trie.rsindex 5dd14ecf8fb..0f7575324b0 100644--- a/crates/project/src/manifest_tree/path_trie.rs+++ b/crates/project/src/manifest_tree/path_trie.rs@@ -98,7 +98,7 @@ impl<Label: Ord + Clone> RootPathTrie<Label> {};}if !current.labels.is_empty() {- (callback)(¤t.worktree_relative_path, ¤t.labels);+ let _ = (callback)(¤t.worktree_relative_path, ¤t.labels);}}diff --git a/crates/project/src/project.rs b/crates/project/src/project.rsindex 924adfc8942..4dc6be97f8a 100644--- a/crates/project/src/project.rs+++ b/crates/project/src/project.rs@@ -3653,7 +3653,7 @@ impl Project {let mut buffer_count = 0;let mut limit_reached = false;let query = Arc::new(query);- let mut chunks = matching_buffers_rx.ready_chunks(64);+ let chunks = matching_buffers_rx.ready_chunks(64);// Now that we know what paths match the query, we will load at most// 64 buffers at a time to avoid overwhelming the main thread. For each@@ -4392,7 +4392,7 @@ impl Project {envelope: TypedEnvelope<proto::LanguageServerPromptRequest>,mut cx: AsyncApp,) -> Result<proto::LanguageServerPromptResponse> {- let (tx, mut rx) = smol::channel::bounded(1);+ let (tx, rx) = smol::channel::bounded(1);let actions: Vec<_> = envelope.payload.actionsdiff --git a/crates/project/src/task_store.rs b/crates/project/src/task_store.rsindex c85cd05e663..c5f3b4ab1c5 100644--- a/crates/project/src/task_store.rs+++ b/crates/project/src/task_store.rs@@ -21,7 +21,7 @@ use crate::{worktree_store::WorktreeStore,};-#[allow(clippy::large_enum_variant)] // platform-dependent warning+// platform-dependent warningpub enum TaskStore {Functional(StoreState),Noop,diff --git a/crates/project/src/terminals.rs b/crates/project/src/terminals.rsindex 14418e85b5e..f666978b613 100644--- a/crates/project/src/terminals.rs+++ b/crates/project/src/terminals.rs@@ -24,7 +24,7 @@ pub struct Terminals {}/// Terminals are opened either for the users shell, or to run a task.-#[allow(clippy::large_enum_variant)]+#[derive(Debug)]pub enum TerminalKind {/// Run a shell at the given path (or $HOME if None)diff --git a/crates/project/src/worktree_store.rs b/crates/project/src/worktree_store.rsindex 3db5ba0842f..d92d39ca2c1 100644--- a/crates/project/src/worktree_store.rs+++ b/crates/project/src/worktree_store.rs@@ -876,7 +876,7 @@ impl WorktreeStore {async fn filter_paths(fs: &Arc<dyn Fs>,- mut input: Receiver<MatchingEntry>,+ input: Receiver<MatchingEntry>,query: &SearchQuery,) -> Result<()> {let mut input = pin!(input);diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rsindex d820c3693d9..00f49a5e82a 100644--- a/crates/project_panel/src/project_panel.rs+++ b/crates/project_panel/src/project_panel.rs@@ -2854,12 +2854,9 @@ impl ProjectPanel {}let precedes_new_entry = if let Some(new_entry_id) = new_entry_parent_id {entry.id == new_entry_id || {- self.ancestors.get(&entry.id).map_or(false, |entries| {- entries- .ancestors- .iter()- .any(|entry_id| *entry_id == new_entry_id)- })+ self.ancestors+ .get(&entry.id)+ .map_or(false, |entries| entries.ancestors.contains(&new_entry_id))}} else {false@@ -3369,10 +3366,7 @@ impl ProjectPanel {.ancestors.get(&entry.id).is_some_and(|auto_folded_dirs| {- auto_folded_dirs- .ancestors- .iter()- .any(|entry_id| *entry_id == edit_state.entry_id)+ auto_folded_dirs.ancestors.contains(&edit_state.entry_id)})};diff --git a/crates/remote/src/ssh_session.rs b/crates/remote/src/ssh_session.rsindex 8c266554ceb..06f6bb12f41 100644--- a/crates/remote/src/ssh_session.rs+++ b/crates/remote/src/ssh_session.rs@@ -925,7 +925,7 @@ impl SshRemoteClient {if missed_heartbeats != 0 {missed_heartbeats = 0;- this.update(cx, |this, mut cx| {+ let _ =this.update(cx, |this, mut cx| {this.handle_heartbeat_result(missed_heartbeats, &mut cx)})?;}diff --git a/crates/repl/src/repl_editor.rs b/crates/repl/src/repl_editor.rsindex 05b10f3f955..f54e2f13687 100644--- a/crates/repl/src/repl_editor.rs+++ b/crates/repl/src/repl_editor.rs@@ -170,7 +170,6 @@ pub fn run(anyhow::Ok(())}-#[allow(clippy::large_enum_variant)]pub enum SessionSupport {ActiveSession(Entity<Session>),Inactive(KernelSpecification),diff --git a/crates/rpc/src/message_stream.rs b/crates/rpc/src/message_stream.rsindex 79d4cd4eae8..87070fa7357 100644--- a/crates/rpc/src/message_stream.rs+++ b/crates/rpc/src/message_stream.rs@@ -20,7 +20,6 @@ pub struct MessageStream<S> {encoding_buffer: Vec<u8>,}-#[allow(clippy::large_enum_variant)]#[derive(Debug)]pub enum Message {Envelope(Envelope),diff --git a/crates/task/src/debug_format.rs b/crates/task/src/debug_format.rsindex 61d6cb7ba5e..806b077b943 100644--- a/crates/task/src/debug_format.rs+++ b/crates/task/src/debug_format.rs@@ -186,7 +186,6 @@ impl From<AttachRequest> for DebugRequest {#[derive(Deserialize, Serialize, PartialEq, Eq, JsonSchema, Clone, Debug)]#[serde(untagged)]-#[allow(clippy::large_enum_variant)]pub enum BuildTaskDefinition {ByName(SharedString),Template {diff --git a/rust-toolchain.toml b/rust-toolchain.tomlindex f819e3b78ed..495d8fbb0b3 100644--- a/rust-toolchain.toml+++ b/rust-toolchain.toml@@ -1,5 +1,5 @@[toolchain]-channel = "1.86"+channel = "1.87"profile = "minimal"components = [ "rustfmt", "clippy" ]targets = [