Skip to content

Commit 985dcf7

Browse files
chore: Bump Rust version to 1.88 (#33439)
Goodies in this version: - if-let chains 🎉 - Better compiler perf for Zed (rust-lang/rust#138522) For more, see: https://releases.rs/docs/1.88.0/ Release Notes: - N/A --------- Co-authored-by: Junkui Zhang <[email protected]>
1 parent b079871 commit 985dcf7

File tree

31 files changed

+112
-303
lines changed

31 files changed

+112
-303
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile-collab

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax = docker/dockerfile:1.2
22

3-
FROM rust:1.87-bookworm as builder
3+
FROM rust:1.88-bookworm as builder
44
WORKDIR app
55
COPY . .
66

crates/agent_ui/src/buffer_codegen.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,15 +1094,9 @@ mod tests {
10941094
};
10951095
use language_model::{LanguageModelRegistry, TokenUsage};
10961096
use rand::prelude::*;
1097-
use serde::Serialize;
10981097
use settings::SettingsStore;
10991098
use std::{future, sync::Arc};
11001099

1101-
#[derive(Serialize)]
1102-
pub struct DummyCompletionRequest {
1103-
pub name: String,
1104-
}
1105-
11061100
#[gpui::test(iterations = 10)]
11071101
async fn test_transform_autoindent(cx: &mut TestAppContext, mut rng: StdRng) {
11081102
init_test(cx);

crates/agent_ui/src/text_thread_editor.rs

Lines changed: 1 addition & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ use workspace::{
6969
searchable::{Direction, SearchableItemHandle},
7070
};
7171
use workspace::{
72-
Save, Toast, ToolbarItemEvent, ToolbarItemLocation, ToolbarItemView, Workspace,
72+
Save, Toast, Workspace,
7373
item::{self, FollowableItem, Item, ItemHandle},
7474
notifications::NotificationId,
7575
pane,
@@ -2924,13 +2924,6 @@ impl FollowableItem for TextThreadEditor {
29242924
}
29252925
}
29262926

2927-
pub struct ContextEditorToolbarItem {
2928-
active_context_editor: Option<WeakEntity<TextThreadEditor>>,
2929-
model_summary_editor: Entity<Editor>,
2930-
}
2931-
2932-
impl ContextEditorToolbarItem {}
2933-
29342927
pub fn render_remaining_tokens(
29352928
context_editor: &Entity<TextThreadEditor>,
29362929
cx: &App,
@@ -2983,98 +2976,6 @@ pub fn render_remaining_tokens(
29832976
)
29842977
}
29852978

2986-
impl Render for ContextEditorToolbarItem {
2987-
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
2988-
let left_side = h_flex()
2989-
.group("chat-title-group")
2990-
.gap_1()
2991-
.items_center()
2992-
.flex_grow()
2993-
.child(
2994-
div()
2995-
.w_full()
2996-
.when(self.active_context_editor.is_some(), |left_side| {
2997-
left_side.child(self.model_summary_editor.clone())
2998-
}),
2999-
)
3000-
.child(
3001-
div().visible_on_hover("chat-title-group").child(
3002-
IconButton::new("regenerate-context", IconName::RefreshTitle)
3003-
.shape(ui::IconButtonShape::Square)
3004-
.tooltip(Tooltip::text("Regenerate Title"))
3005-
.on_click(cx.listener(move |_, _, _window, cx| {
3006-
cx.emit(ContextEditorToolbarItemEvent::RegenerateSummary)
3007-
})),
3008-
),
3009-
);
3010-
3011-
let right_side = h_flex()
3012-
.gap_2()
3013-
// TODO display this in a nicer way, once we have a design for it.
3014-
// .children({
3015-
// let project = self
3016-
// .workspace
3017-
// .upgrade()
3018-
// .map(|workspace| workspace.read(cx).project().downgrade());
3019-
//
3020-
// let scan_items_remaining = cx.update_global(|db: &mut SemanticDb, cx| {
3021-
// project.and_then(|project| db.remaining_summaries(&project, cx))
3022-
// });
3023-
// scan_items_remaining
3024-
// .map(|remaining_items| format!("Files to scan: {}", remaining_items))
3025-
// })
3026-
.children(
3027-
self.active_context_editor
3028-
.as_ref()
3029-
.and_then(|editor| editor.upgrade())
3030-
.and_then(|editor| render_remaining_tokens(&editor, cx)),
3031-
);
3032-
3033-
h_flex()
3034-
.px_0p5()
3035-
.size_full()
3036-
.gap_2()
3037-
.justify_between()
3038-
.child(left_side)
3039-
.child(right_side)
3040-
}
3041-
}
3042-
3043-
impl ToolbarItemView for ContextEditorToolbarItem {
3044-
fn set_active_pane_item(
3045-
&mut self,
3046-
active_pane_item: Option<&dyn ItemHandle>,
3047-
_window: &mut Window,
3048-
cx: &mut Context<Self>,
3049-
) -> ToolbarItemLocation {
3050-
self.active_context_editor = active_pane_item
3051-
.and_then(|item| item.act_as::<TextThreadEditor>(cx))
3052-
.map(|editor| editor.downgrade());
3053-
cx.notify();
3054-
if self.active_context_editor.is_none() {
3055-
ToolbarItemLocation::Hidden
3056-
} else {
3057-
ToolbarItemLocation::PrimaryRight
3058-
}
3059-
}
3060-
3061-
fn pane_focus_update(
3062-
&mut self,
3063-
_pane_focused: bool,
3064-
_window: &mut Window,
3065-
cx: &mut Context<Self>,
3066-
) {
3067-
cx.notify();
3068-
}
3069-
}
3070-
3071-
impl EventEmitter<ToolbarItemEvent> for ContextEditorToolbarItem {}
3072-
3073-
pub enum ContextEditorToolbarItemEvent {
3074-
RegenerateSummary,
3075-
}
3076-
impl EventEmitter<ContextEditorToolbarItemEvent> for ContextEditorToolbarItem {}
3077-
30782979
enum PendingSlashCommand {}
30792980

30802981
fn invoked_slash_command_fold_placeholder(

crates/assistant_slash_commands/src/delta_command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl SlashCommand for DeltaSlashCommand {
7474
.slice(section.range.to_offset(&context_buffer)),
7575
);
7676
file_command_new_outputs.push(Arc::new(FileSlashCommand).run(
77-
&[metadata.path.clone()],
77+
std::slice::from_ref(&metadata.path),
7878
context_slash_command_output_sections,
7979
context_buffer.clone(),
8080
workspace.clone(),

crates/buffer_diff/src/buffer_diff.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,7 @@ mod tests {
18671867
let hunk = diff.hunks(&buffer, cx).next().unwrap();
18681868

18691869
let new_index_text = diff
1870-
.stage_or_unstage_hunks(true, &[hunk.clone()], &buffer, true, cx)
1870+
.stage_or_unstage_hunks(true, std::slice::from_ref(&hunk), &buffer, true, cx)
18711871
.unwrap()
18721872
.to_string();
18731873
assert_eq!(new_index_text, buffer_text);

crates/collab/src/db/tests/embedding_tests.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ async fn test_purge_old_embeddings(cx: &mut gpui::TestAppContext) {
7676
db.purge_old_embeddings().await.unwrap();
7777

7878
// Try to retrieve the purged embeddings
79-
let retrieved_embeddings = db.get_embeddings(model, &[digest.clone()]).await.unwrap();
79+
let retrieved_embeddings = db
80+
.get_embeddings(model, std::slice::from_ref(&digest))
81+
.await
82+
.unwrap();
8083
assert!(
8184
retrieved_embeddings.is_empty(),
8285
"Old embeddings should have been purged"

crates/collab/src/rpc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ struct Session {
179179
}
180180

181181
impl Session {
182-
async fn db(&self) -> tokio::sync::MutexGuard<DbHandle> {
182+
async fn db(&self) -> tokio::sync::MutexGuard<'_, DbHandle> {
183183
#[cfg(test)]
184184
tokio::task::yield_now().await;
185185
let guard = self.db.lock().await;
@@ -1037,7 +1037,7 @@ impl Server {
10371037
}
10381038
}
10391039

1040-
pub async fn snapshot(self: &Arc<Self>) -> ServerSnapshot {
1040+
pub async fn snapshot(self: &Arc<Self>) -> ServerSnapshot<'_> {
10411041
ServerSnapshot {
10421042
connection_pool: ConnectionPoolGuard {
10431043
guard: self.connection_pool.lock(),

crates/editor/src/editor.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3897,8 +3897,10 @@ impl Editor {
38973897
bracket_pair_matching_end = Some(pair.clone());
38983898
}
38993899
}
3900-
if bracket_pair.is_none() && bracket_pair_matching_end.is_some() {
3901-
bracket_pair = Some(bracket_pair_matching_end.unwrap());
3900+
if let Some(end) = bracket_pair_matching_end
3901+
&& bracket_pair.is_none()
3902+
{
3903+
bracket_pair = Some(end);
39023904
is_bracket_pair_end = true;
39033905
}
39043906
}
@@ -13381,7 +13383,12 @@ impl Editor {
1338113383
window: &mut Window,
1338213384
cx: &mut Context<Editor>,
1338313385
) {
13384-
self.unfold_ranges(&[range.clone()], false, auto_scroll.is_some(), cx);
13386+
self.unfold_ranges(
13387+
std::slice::from_ref(&range),
13388+
false,
13389+
auto_scroll.is_some(),
13390+
cx,
13391+
);
1338513392
self.change_selections(auto_scroll, window, cx, |s| {
1338613393
if replace_newest {
1338713394
s.delete(s.newest_anchor().id);

0 commit comments

Comments
 (0)