这是indexloc提供的服务,不要输入任何密码
Skip to content

chore: update to Rust 1.87.0 #10482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/turborepo-filewatch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#![deny(clippy::all)]
#![allow(clippy::mutable_key_type)]
#![allow(clippy::result_large_err)]
#![feature(assert_matches)]

use std::{
Expand Down
1 change: 0 additions & 1 deletion crates/turborepo-globwatch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
unused_must_use,
unsafe_code
)]
#![feature(extract_if)]

use std::{
collections::HashMap,
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![feature(assert_matches)]
#![feature(box_patterns)]
#![feature(error_generic_member_access)]
#![feature(hash_extract_if)]
#![feature(once_cell_try)]
#![feature(try_blocks)]
#![feature(impl_trait_in_assoc_type)]
Expand All @@ -10,6 +9,7 @@
#![allow(clippy::needless_pass_by_ref_mut)]
// Code generated by tonic-build don't follow this lint
#![allow(clippy::needless_lifetimes)]
#![allow(clippy::result_large_err)]
#![allow(dead_code)]

mod child;
Expand Down
4 changes: 2 additions & 2 deletions crates/turborepo-lib/src/package_changes_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl PackageChangesWatcher {
enum ChangedFiles {
All,
// Trie doesn't support PathBuf as a key on Windows, so we need to use `String`
Some(Trie<String, ()>),
Some(Box<Trie<String, ()>>),
}

impl ChangedFiles {
Expand All @@ -88,7 +88,7 @@ impl ChangedFiles {

impl Default for ChangedFiles {
fn default() -> Self {
ChangedFiles::Some(Trie::new())
ChangedFiles::Some(Box::new(Trie::new()))
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/turborepo-process/src/child.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl ChildHandle {
.openpty(size)
.map_err(|err| match err.downcast() {
Ok(err) => err,
Err(err) => io::Error::new(io::ErrorKind::Other, err),
Err(err) => io::Error::other(err),
})?;

let controller = pair.master;
Expand Down Expand Up @@ -168,7 +168,7 @@ impl ChildHandle {
.spawn_command(command)
.map_err(|err| match err.downcast() {
Ok(err) => err,
Err(err) => io::Error::new(io::ErrorKind::Other, err),
Err(err) => io::Error::other(err),
})?;

let pid = child.process_id();
Expand Down
1 change: 1 addition & 0 deletions crates/turborepo-repository/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![feature(assert_matches)]
#![feature(error_generic_member_access)]
#![allow(clippy::result_large_err)]

pub mod change_mapper;
pub mod discovery;
Expand Down
1 change: 1 addition & 0 deletions crates/turborepo-scm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#![feature(io_error_more)]
#![feature(assert_matches)]
#![deny(clippy::all)]
#![allow(clippy::result_large_err)]

//! Turborepo's library for interacting with source control management (SCM).
//! Currently we only support git. We use SCM for finding changed files,
Expand Down
1 change: 1 addition & 0 deletions crates/turborepo-ui/src/color_selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct ColorSelectorInner {
}

impl ColorSelector {
#[allow(clippy::let_and_return)]
pub fn color_for_key(&self, key: &str) -> &'static Style {
if let Some(style) = self.inner.read().expect("lock poisoned").color(key) {
return style;
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-ui/src/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl std::io::Write for TaskSender {

self.handle
.output(task, buf.to_vec())
.map_err(|_| std::io::Error::new(std::io::ErrorKind::Other, "receiver dropped"))?;
.map_err(|_| std::io::Error::other("receiver dropped"))?;
Ok(buf.len())
}

Expand Down
6 changes: 1 addition & 5 deletions crates/turborepo-vt100/src/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -820,11 +820,7 @@ impl Grid {
let in_scroll_region = self.in_scroll_region();
// need to account for clamping by both row_clamp_top and by
// saturating_sub
let extra_lines = if count > self.pos.row {
count - self.pos.row
} else {
0
};
let extra_lines = count.saturating_sub(self.pos.row);
self.pos.row = self.pos.row.saturating_sub(count);
let lines = self.row_clamp_top(in_scroll_region);
self.scroll_down(lines + extra_lines);
Expand Down
9 changes: 5 additions & 4 deletions packages/turbo-repository/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,11 @@ impl Workspace {
.collect();

// Create a ChangeMapper with no ignore patterns
let change_detector = base
.is_some()
.then(|| Either::Left(DefaultPackageChangeMapperWithLockfile::new(&self.graph)))
.unwrap_or_else(|| Either::Right(DefaultPackageChangeMapper::new(&self.graph)));
let change_detector = if base.is_some() {
Either::Left(DefaultPackageChangeMapperWithLockfile::new(&self.graph))
} else {
Either::Right(DefaultPackageChangeMapper::new(&self.graph))
};
let mapper = ChangeMapper::new(&self.graph, vec![], change_detector);

let lockfile_contents = if let Some(base) = base {
Expand Down
2 changes: 1 addition & 1 deletion packages/turbo-repository/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ script_provided_flags="\
for flag in $user_provided_flags; do
if [[ $flag == --target=* ]]; then
target=${flag#*=}
rustup toolchain install nightly-2025-02-14 --target "$target"
rustup toolchain install nightly-2025-03-28 --target "$target"

# For we need to cross-compile some targets with Zig
# Fortunately, napi comes with a `--zig` flag
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
# Needs to be copied to `packages/turbo-repository/scripts/build.sh`
channel = "nightly-2025-02-14"
channel = "nightly-2025-03-28"
components = ["rustfmt", "clippy"]
profile = "minimal"
Loading