chore: Bump Rust edition to 2024 (#27800)

Follow-up to https://github.com/zed-industries/zed/pull/27791

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-03-31 20:55:27 +02:00 committed by GitHub
parent d50905e000
commit dc64ec9cc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
802 changed files with 3775 additions and 3662 deletions

View file

@ -1,20 +1,20 @@
//! Module for managing breakpoints in a project.
//!
//! Breakpoints are separate from a session because they're not associated with any particular debug session. They can also be set up without a session running.
use anyhow::{anyhow, Result};
use anyhow::{Result, anyhow};
use breakpoints_in_file::BreakpointsInFile;
use collections::BTreeMap;
use dap::client::SessionId;
use gpui::{App, AppContext, AsyncApp, Context, Entity, EventEmitter, Subscription, Task};
use language::{proto::serialize_anchor as serialize_text_anchor, Buffer, BufferSnapshot};
use language::{Buffer, BufferSnapshot, proto::serialize_anchor as serialize_text_anchor};
use rpc::{
proto::{self},
AnyProtoClient, TypedEnvelope,
proto::{self},
};
use std::{hash::Hash, ops::Range, path::Path, sync::Arc};
use text::PointUtf16;
use crate::{buffer_store::BufferStore, worktree_store::WorktreeStore, Project, ProjectPath};
use crate::{Project, ProjectPath, buffer_store::BufferStore, worktree_store::WorktreeStore};
mod breakpoints_in_file {
use language::BufferEvent;

View file

@ -1,14 +1,14 @@
use std::sync::Arc;
use anyhow::{anyhow, Ok, Result};
use anyhow::{Ok, Result, anyhow};
use dap::{
client::SessionId,
proto_conversions::ProtoConversion,
requests::{Continue, Next},
Capabilities, ContinueArguments, InitializeRequestArguments,
InitializeRequestArgumentsPathFormat, NextArguments, SetVariableResponse, SourceBreakpoint,
StepInArguments, StepOutArguments, SteppingGranularity, ValueFormat, Variable,
VariablesArgumentsFilter,
client::SessionId,
proto_conversions::ProtoConversion,
requests::{Continue, Next},
};
use rpc::proto;
use serde_json::Value;

View file

@ -3,23 +3,23 @@ use super::{
locator_store::LocatorStore,
session::{self, Session},
};
use crate::{debugger, worktree_store::WorktreeStore, ProjectEnvironment};
use anyhow::{anyhow, Result};
use crate::{ProjectEnvironment, debugger, worktree_store::WorktreeStore};
use anyhow::{Result, anyhow};
use async_trait::async_trait;
use collections::HashMap;
use dap::{
Capabilities, CompletionItem, CompletionsArguments, DapRegistry, ErrorResponse,
EvaluateArguments, EvaluateArgumentsContext, EvaluateResponse, RunInTerminalRequestArguments,
Source, StartDebuggingRequestArguments,
adapters::{DapStatus, DebugAdapterName},
client::SessionId,
messages::Message,
requests::{Completions, Evaluate, Request as _, RunInTerminal, StartDebugging},
Capabilities, CompletionItem, CompletionsArguments, DapRegistry, ErrorResponse,
EvaluateArguments, EvaluateArgumentsContext, EvaluateResponse, RunInTerminalRequestArguments,
Source, StartDebuggingRequestArguments,
};
use fs::Fs;
use futures::{
channel::{mpsc, oneshot},
future::{join_all, Shared},
future::{Shared, join_all},
};
use gpui::{App, AppContext, AsyncApp, Context, Entity, EventEmitter, SharedString, Task};
use http_client::HttpClient;
@ -28,8 +28,8 @@ use lsp::LanguageServerName;
use node_runtime::NodeRuntime;
use rpc::{
proto::{self},
AnyProtoClient, TypedEnvelope,
proto::{self},
};
use serde_json::Value;
use settings::WorktreeId;
@ -39,7 +39,7 @@ use std::{
collections::{BTreeMap, HashSet},
ffi::OsStr,
path::PathBuf,
sync::{atomic::Ordering::SeqCst, Arc},
sync::{Arc, atomic::Ordering::SeqCst},
};
use std::{collections::VecDeque, sync::atomic::AtomicU32};
use task::{DebugAdapterConfig, DebugRequestDisposition};

View file

@ -1,4 +1,4 @@
use anyhow::{anyhow, Result};
use anyhow::{Result, anyhow};
use cargo::CargoLocator;
use collections::HashMap;
use dap::DebugAdapterConfig;

View file

@ -1,5 +1,5 @@
use super::DapLocator;
use anyhow::{anyhow, Result};
use anyhow::{Result, anyhow};
use async_trait::async_trait;
use dap::DebugAdapterConfig;
use serde_json::Value;

View file

@ -10,25 +10,25 @@ use super::dap_command::{
VariablesCommand,
};
use super::dap_store::DapAdapterDelegate;
use anyhow::{anyhow, Result};
use anyhow::{Result, anyhow};
use collections::{HashMap, HashSet, IndexMap, IndexSet};
use dap::adapters::{DebugAdapter, DebugAdapterBinary};
use dap::messages::Response;
use dap::{
Capabilities, ContinueArguments, EvaluateArgumentsContext, Module, Source, StackFrameId,
SteppingGranularity, StoppedEvent, VariableReference,
adapters::{DapDelegate, DapStatus},
client::{DebugAdapterClient, SessionId},
messages::{Events, Message},
Capabilities, ContinueArguments, EvaluateArgumentsContext, Module, Source, StackFrameId,
SteppingGranularity, StoppedEvent, VariableReference,
};
use dap::{DapRegistry, DebugRequestType, OutputEventCategory};
use futures::channel::oneshot;
use futures::{future::Shared, FutureExt};
use futures::{FutureExt, future::Shared};
use gpui::{
App, AppContext, AsyncApp, BackgroundExecutor, Context, Entity, EventEmitter, Task, WeakEntity,
};
use rpc::AnyProtoClient;
use serde_json::{json, Value};
use serde_json::{Value, json};
use settings::Settings;
use smol::stream::StreamExt;
use std::any::TypeId;
@ -43,7 +43,7 @@ use std::{
};
use task::{DebugAdapterConfig, DebugTaskDefinition};
use text::{PointUtf16, ToPointUtf16};
use util::{merge_json_value_into, ResultExt};
use util::{ResultExt, merge_json_value_into};
#[derive(Debug, Copy, Clone, Hash, PartialEq, PartialOrd, Ord, Eq)]
#[repr(transparent)]
@ -1194,8 +1194,12 @@ impl Session {
fn fetch<T: DapCommand + PartialEq + Eq + Hash>(
&mut self,
request: T,
process_result: impl FnOnce(&mut Self, Result<T::Response>, &mut Context<Self>) -> Option<T::Response>
+ 'static,
process_result: impl FnOnce(
&mut Self,
Result<T::Response>,
&mut Context<Self>,
) -> Option<T::Response>
+ 'static,
cx: &mut Context<Self>,
) {
const {
@ -1246,8 +1250,12 @@ impl Session {
session_id: SessionId,
mode: &Mode,
request: T,
process_result: impl FnOnce(&mut Self, Result<T::Response>, &mut Context<Self>) -> Option<T::Response>
+ 'static,
process_result: impl FnOnce(
&mut Self,
Result<T::Response>,
&mut Context<Self>,
) -> Option<T::Response>
+ 'static,
cx: &mut Context<Self>,
) -> Task<Option<T::Response>> {
if !T::is_supported(&capabilities) {
@ -1277,8 +1285,12 @@ impl Session {
fn request<T: DapCommand + PartialEq + Eq + Hash>(
&self,
request: T,
process_result: impl FnOnce(&mut Self, Result<T::Response>, &mut Context<Self>) -> Option<T::Response>
+ 'static,
process_result: impl FnOnce(
&mut Self,
Result<T::Response>,
&mut Context<Self>,
) -> Option<T::Response>
+ 'static,
cx: &mut Context<Self>,
) -> Task<Option<T::Response>> {
Self::request_inner(