Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Bump Rust version to 1.92 (#44649)

Piotr Osiewicz975a76bbf09e
diff --git a/Dockerfile-collab b/Dockerfile-collab
index 68f898618a5..188e7daddfb 100644
--- a/Dockerfile-collab
+++ b/Dockerfile-collab
@@ -1,6 +1,6 @@
# syntax = docker/dockerfile:1.2
-FROM rust:1.91.1-bookworm as builder
+FROM rust:1.92-bookworm as builder
WORKDIR app
COPY . .
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index f4a83f900da..4072b1db7a1 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -15534,10 +15534,9 @@ impl Editor {
I: IntoIterator<Item = P>,
P: AsRef<[u8]>,
{
- let case_sensitive = self.select_next_is_case_sensitive.map_or_else(
- || EditorSettings::get_global(cx).search.case_sensitive,
- |value| value,
- );
+ let case_sensitive = self
+ .select_next_is_case_sensitive
+ .unwrap_or_else(|| EditorSettings::get_global(cx).search.case_sensitive);
let mut builder = AhoCorasickBuilder::new();
builder.ascii_case_insensitive(!case_sensitive);
diff --git a/crates/git_ui/src/branch_picker.rs b/crates/git_ui/src/branch_picker.rs
index c7cf72cdbd8..cbf3fea72a9 100644
--- a/crates/git_ui/src/branch_picker.rs
+++ b/crates/git_ui/src/branch_picker.rs
@@ -969,12 +969,12 @@ impl PickerDelegate for BranchListDelegate {
"No commits found".into(),
|subject| {
if show_author_name
- && author_name.is_some()
+ && let Some(author) =
+ author_name
{
format!(
"{} • {}",
- author_name.unwrap(),
- subject
+ author, subject
)
} else {
subject.to_string()
diff --git a/crates/gpui/src/elements/surface.rs b/crates/gpui/src/elements/surface.rs
index b4fced1001b..ac1c247b47e 100644
--- a/crates/gpui/src/elements/surface.rs
+++ b/crates/gpui/src/elements/surface.rs
@@ -29,6 +29,7 @@ pub struct Surface {
}
/// Create a new surface element.
+#[cfg(target_os = "macos")]
pub fn surface(source: impl Into<SurfaceSource>) -> Surface {
Surface {
source: source.into(),
diff --git a/crates/gpui/src/elements/uniform_list.rs b/crates/gpui/src/elements/uniform_list.rs
index 1e38b0e7ac9..1ad71b97673 100644
--- a/crates/gpui/src/elements/uniform_list.rs
+++ b/crates/gpui/src/elements/uniform_list.rs
@@ -712,8 +712,8 @@ mod test {
#[gpui::test]
fn test_scroll_strategy_nearest(cx: &mut TestAppContext) {
use crate::{
- Context, FocusHandle, ScrollStrategy, UniformListScrollHandle, Window, actions, div,
- prelude::*, px, uniform_list,
+ Context, FocusHandle, ScrollStrategy, UniformListScrollHandle, Window, div, prelude::*,
+ px, uniform_list,
};
use std::ops::Range;
diff --git a/crates/language/src/buffer.rs b/crates/language/src/buffer.rs
index 59795c375ab..a0ec214c765 100644
--- a/crates/language/src/buffer.rs
+++ b/crates/language/src/buffer.rs
@@ -3303,8 +3303,7 @@ impl BufferSnapshot {
// set its end to the outdent position
if let Some(range_to_truncate) = indent_ranges
.iter_mut()
- .filter(|indent_range| indent_range.contains(&outdent_position))
- .next_back()
+ .rfind(|indent_range| indent_range.contains(&outdent_position))
{
range_to_truncate.end = outdent_position;
}
diff --git a/crates/project/src/lsp_store.rs b/crates/project/src/lsp_store.rs
index 2ea3dbf70fc..83c2abfbb86 100644
--- a/crates/project/src/lsp_store.rs
+++ b/crates/project/src/lsp_store.rs
@@ -2285,12 +2285,10 @@ impl LocalLspStore {
&& lsp_action.data.is_some()
&& (lsp_action.command.is_none() || lsp_action.edit.is_none())
{
- *lsp_action = Box::new(
- lang_server
- .request::<lsp::request::CodeActionResolveRequest>(*lsp_action.clone())
- .await
- .into_response()?,
- );
+ **lsp_action = lang_server
+ .request::<lsp::request::CodeActionResolveRequest>(*lsp_action.clone())
+ .await
+ .into_response()?;
}
}
LspAction::CodeLens(lens) => {
@@ -6480,7 +6478,7 @@ impl LspStore {
server_id == *completion_server_id,
"server_id mismatch, applying completion resolve for {server_id} but completion server id is {completion_server_id}"
);
- *lsp_completion = Box::new(resolved_completion);
+ **lsp_completion = resolved_completion;
*resolved = true;
}
Ok(())
@@ -6639,7 +6637,7 @@ impl LspStore {
server_id == *completion_server_id,
"remote server_id mismatch, applying completion resolve for {server_id} but completion server id is {completion_server_id}"
);
- *lsp_completion = Box::new(resolved_lsp_completion);
+ **lsp_completion = resolved_lsp_completion;
*resolved = true;
}
diff --git a/crates/vim/src/motion.rs b/crates/vim/src/motion.rs
index 6ba28a1c236..f2e629faf2d 100644
--- a/crates/vim/src/motion.rs
+++ b/crates/vim/src/motion.rs
@@ -1,5 +1,5 @@
use editor::{
- Anchor, Bias, BufferOffset, DisplayPoint, Editor, MultiBufferOffset, RowExt, ToOffset, ToPoint,
+ Anchor, Bias, BufferOffset, DisplayPoint, Editor, MultiBufferOffset, RowExt, ToOffset,
display_map::{DisplayRow, DisplaySnapshot, FoldPoint, ToDisplayPoint},
movement::{
self, FindRange, TextLayoutDetails, find_boundary, find_preceding_boundary_display_point,
@@ -2262,7 +2262,6 @@ fn go_to_line(map: &DisplaySnapshot, display_point: DisplayPoint, line: usize) -
.offset_to_point(excerpt.map_offset_from_buffer(BufferOffset(offset)));
return map.clip_point(map.point_to_display_point(point, Bias::Left), Bias::Left);
}
- let mut last_position = None;
for (excerpt, buffer, range) in map.buffer_snapshot().excerpts() {
let excerpt_range = language::ToOffset::to_offset(&range.context.start, buffer)
..language::ToOffset::to_offset(&range.context.end, buffer);
@@ -2273,14 +2272,9 @@ fn go_to_line(map: &DisplaySnapshot, display_point: DisplayPoint, line: usize) -
} else if offset <= excerpt_range.start {
let anchor = Anchor::in_buffer(excerpt, range.context.start);
return anchor.to_display_point(map);
- } else {
- last_position = Some(Anchor::in_buffer(excerpt, range.context.end));
}
}
- let mut last_point = last_position.unwrap().to_point(&map.buffer_snapshot());
- last_point.column = point.column;
-
map.clip_point(
map.point_to_display_point(
map.buffer_snapshot().clip_point(point, Bias::Left),
diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs
index c1d98936aa2..fc5e74a7690 100644
--- a/crates/zed/src/zed.rs
+++ b/crates/zed/src/zed.rs
@@ -353,6 +353,8 @@ pub fn initialize_workspace(
) {
let mut _on_close_subscription = bind_on_window_closed(cx);
cx.observe_global::<SettingsStore>(move |cx| {
+ // A 1.92 regression causes unused-assignment to trigger on this variable.
+ _ = _on_close_subscription.is_some();
_on_close_subscription = bind_on_window_closed(cx);
})
.detach();
diff --git a/flake.lock b/flake.lock
index 520dcb3f746..561919d5745 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,11 +2,11 @@
"nodes": {
"crane": {
"locked": {
- "lastModified": 1762538466,
- "narHash": "sha256-8zrIPl6J+wLm9MH5ksHcW7BUHo7jSNOu0/hA0ohOOaM=",
+ "lastModified": 1765145449,
+ "narHash": "sha256-aBVHGWWRzSpfL++LubA0CwOOQ64WNLegrYHwsVuVN7A=",
"owner": "ipetkov",
"repo": "crane",
- "rev": "0cea393fffb39575c46b7a0318386467272182fe",
+ "rev": "69f538cdce5955fcd47abfed4395dc6d5194c1c5",
"type": "github"
},
"original": {
@@ -17,11 +17,11 @@
},
"flake-compat": {
"locked": {
- "lastModified": 1761588595,
- "narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
+ "lastModified": 1765121682,
+ "narHash": "sha256-4VBOP18BFeiPkyhy9o4ssBNQEvfvv1kXkasAYd0+rrA=",
"owner": "edolstra",
"repo": "flake-compat",
- "rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
+ "rev": "65f23138d8d09a92e30f1e5c87611b23ef451bf3",
"type": "github"
},
"original": {
@@ -53,16 +53,14 @@
},
"rust-overlay": {
"inputs": {
- "nixpkgs": [
- "nixpkgs"
- ]
+ "nixpkgs": ["nixpkgs"]
},
"locked": {
- "lastModified": 1762915112,
- "narHash": "sha256-d9j1g8nKmYDHy+/bIOPQTh9IwjRliqaTM0QLHMV92Ic=",
+ "lastModified": 1765465581,
+ "narHash": "sha256-fCXT0aZXmTalM3NPCTedVs9xb0egBG5BOZkcrYo5PGE=",
"owner": "oxalica",
"repo": "rust-overlay",
- "rev": "aa1e85921cfa04de7b6914982a94621fbec5cc02",
+ "rev": "99cc5667eece98bb35dcf35f7e511031a8b7a125",
"type": "github"
},
"original": {
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index 59765d94abe..e7cc22421d7 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -1,5 +1,5 @@
[toolchain]
-channel = "1.91.1"
+channel = "1.92"
profile = "minimal"
components = [ "rustfmt", "clippy" ]
targets = [