Skip to content

Commit 9bdd9fd

Browse files
committed
chore: update to Rust 1.91.0
1 parent f226417 commit 9bdd9fd

File tree

10 files changed

+52
-90
lines changed

10 files changed

+52
-90
lines changed

crates/turborepo-lib/src/cli/mod.rs

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ const DEFAULT_NUM_WORKERS: u32 = 10;
4848
const SUPPORTED_GRAPH_FILE_EXTENSIONS: [&str; 8] =
4949
["svg", "png", "jpg", "pdf", "json", "html", "mermaid", "dot"];
5050

51-
#[derive(Copy, Clone, Debug, PartialEq, Eq, ValueEnum, Deserializable, Serialize)]
51+
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, ValueEnum, Deserializable, Serialize)]
5252
pub enum OutputLogsMode {
5353
#[serde(rename = "full")]
54+
#[default]
5455
Full,
5556
#[serde(rename = "none")]
5657
None,
@@ -62,12 +63,6 @@ pub enum OutputLogsMode {
6263
ErrorsOnly,
6364
}
6465

65-
impl Default for OutputLogsMode {
66-
fn default() -> Self {
67-
Self::Full
68-
}
69-
}
70-
7166
impl Display for OutputLogsMode {
7267
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7368
f.write_str(match self {
@@ -92,22 +87,17 @@ impl From<OutputLogsMode> for turborepo_ui::tui::event::OutputLogs {
9287
}
9388
}
9489

95-
#[derive(Copy, Clone, Debug, PartialEq, Serialize, ValueEnum, Deserialize, Eq)]
90+
#[derive(Copy, Clone, Debug, Default, PartialEq, Serialize, ValueEnum, Deserialize, Eq)]
9691
pub enum LogOrder {
9792
#[serde(rename = "auto")]
93+
#[default]
9894
Auto,
9995
#[serde(rename = "stream")]
10096
Stream,
10197
#[serde(rename = "grouped")]
10298
Grouped,
10399
}
104100

105-
impl Default for LogOrder {
106-
fn default() -> Self {
107-
Self::Auto
108-
}
109-
}
110-
111101
impl Display for LogOrder {
112102
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
113103
f.write_str(match self {
@@ -1162,22 +1152,17 @@ impl RunArgs {
11621152
}
11631153
}
11641154

1165-
#[derive(ValueEnum, Clone, Copy, Debug, PartialEq, Serialize)]
1155+
#[derive(ValueEnum, Clone, Copy, Debug, Default, PartialEq, Serialize)]
11661156
pub enum LogPrefix {
11671157
#[serde(rename = "auto")]
1158+
#[default]
11681159
Auto,
11691160
#[serde(rename = "none")]
11701161
None,
11711162
#[serde(rename = "task")]
11721163
Task,
11731164
}
11741165

1175-
impl Default for LogPrefix {
1176-
fn default() -> Self {
1177-
Self::Auto
1178-
}
1179-
}
1180-
11811166
impl Display for LogPrefix {
11821167
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
11831168
match self {

crates/turborepo-lib/src/engine/builder.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -732,16 +732,18 @@ impl<'a> EngineBuilder<'a> {
732732
.load(package_name)
733733
.map(Some)
734734
.or_else(|err| {
735-
if let Some((span, text)) = read_req.required()
736-
&& matches!(err, config::Error::NoTurboJSON)
737-
{
738-
Err(Error::MissingTurboJsonExtends(Box::new(
739-
MissingTurboJsonExtends {
740-
package_name: read_req.package_name().to_string(),
741-
span,
742-
text,
743-
},
744-
)))
735+
if let Some((span, text)) = read_req.required() {
736+
if matches!(err, config::Error::NoTurboJSON) {
737+
Err(Error::MissingTurboJsonExtends(Box::new(
738+
MissingTurboJsonExtends {
739+
package_name: read_req.package_name().to_string(),
740+
span,
741+
text,
742+
},
743+
)))
744+
} else {
745+
Err(err.into())
746+
}
745747
} else if matches!(err, config::Error::NoTurboJSON) {
746748
Ok(None)
747749
} else {

crates/turborepo-lib/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![feature(once_cell_try)]
55
#![feature(try_blocks)]
66
#![feature(impl_trait_in_assoc_type)]
7-
#![feature(let_chains)]
87
#![deny(clippy::all)]
98
// Clippy's needless mut lint is buggy: https://github.com/rust-lang/rust-clippy/issues/11299
109
#![allow(clippy::needless_pass_by_ref_mut)]

crates/turborepo-lib/src/turbo_json/mod.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,23 +99,20 @@ impl DerefMut for Pipeline {
9999
}
100100
}
101101

102-
#[derive(Serialize, Deserialize, Debug, Copy, Clone, Deserializable, PartialEq, Eq, ValueEnum)]
102+
#[derive(
103+
Serialize, Deserialize, Debug, Default, Copy, Clone, Deserializable, PartialEq, Eq, ValueEnum,
104+
)]
103105
#[serde(rename_all = "camelCase")]
104106
pub enum UIMode {
105107
/// Use the terminal user interface
108+
#[default]
106109
Tui,
107110
/// Use the standard output stream
108111
Stream,
109112
/// Use the web user interface (experimental)
110113
Web,
111114
}
112115

113-
impl Default for UIMode {
114-
fn default() -> Self {
115-
Self::Tui
116-
}
117-
}
118-
119116
impl Display for UIMode {
120117
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
121118
match self {

crates/turborepo-lib/src/turbo_json/validator.rs

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -98,28 +98,27 @@ pub fn validate_extends(validator: &Validator, turbo_json: &TurboJson) -> Vec<Er
9898
text: NamedSource::new(path, text),
9999
}];
100100
}
101-
if let Some(package_name) = turbo_json.extends.first()
102-
&& package_name != ROOT_PKG_NAME
103-
&& validator.non_root_extends
104-
{
105-
let path = turbo_json
106-
.path
107-
.as_ref()
108-
.map_or("turbo.json", |p| p.as_ref());
101+
if let Some(package_name) = turbo_json.extends.first() {
102+
if package_name != ROOT_PKG_NAME && validator.non_root_extends {
103+
let path = turbo_json
104+
.path
105+
.as_ref()
106+
.map_or("turbo.json", |p| p.as_ref());
109107

110-
let (span, text) = match turbo_json.text {
111-
Some(ref text) => {
112-
let len = text.len();
113-
let span: SourceSpan = (0, len - 1).into();
114-
(Some(span), text.to_string())
115-
}
116-
None => (None, String::new()),
117-
};
118-
// Root needs to be first
119-
return vec![Error::ExtendsRootFirst {
120-
span,
121-
text: NamedSource::new(path, text),
122-
}];
108+
let (span, text) = match turbo_json.text {
109+
Some(ref text) => {
110+
let len = text.len();
111+
let span: SourceSpan = (0, len - 1).into();
112+
(Some(span), text.to_string())
113+
}
114+
None => (None, String::new()),
115+
};
116+
// Root needs to be first
117+
return vec![Error::ExtendsRootFirst {
118+
span,
119+
text: NamedSource::new(path, text),
120+
}];
121+
}
123122
}
124123
// If we allow for non-root extends we don't need to perform this check
125124
(!validator.non_root_extends

crates/turborepo-lockfiles/src/bun/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ type Map<K, V> = std::collections::BTreeMap<K, V>;
112112

113113
/// Represents a platform constraint that can be either inclusive or exclusive.
114114
/// This matches Bun's Negatable type for os/cpu/libc fields.
115-
#[derive(Debug, Clone, PartialEq, Eq)]
115+
#[derive(Debug, Default, Clone, PartialEq, Eq)]
116116
pub enum Negatable {
117117
/// No constraint - package works on all platforms
118+
#[default]
118119
None,
119120
/// Single platform constraint
120121
Single(String),
@@ -124,12 +125,6 @@ pub enum Negatable {
124125
Negated(Vec<String>),
125126
}
126127

127-
impl Default for Negatable {
128-
fn default() -> Self {
129-
Self::None
130-
}
131-
}
132-
133128
impl Serialize for Negatable {
134129
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
135130
where

crates/turborepo-vt100/src/attrs.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
use crate::term::BufWrite as _;
22

33
/// Represents a foreground or background color for cells.
4-
#[derive(Eq, PartialEq, Debug, Copy, Clone)]
4+
#[derive(Eq, PartialEq, Debug, Default, Copy, Clone)]
55
pub enum Color {
66
/// The default terminal color.
7+
#[default]
78
Default,
89

910
/// An indexed terminal color.
@@ -13,12 +14,6 @@ pub enum Color {
1314
Rgb(u8, u8, u8),
1415
}
1516

16-
impl Default for Color {
17-
fn default() -> Self {
18-
Self::Default
19-
}
20-
}
21-
2217
const TEXT_MODE_BOLD: u8 = 0b0000_0001;
2318
const TEXT_MODE_ITALIC: u8 = 0b0000_0010;
2419
const TEXT_MODE_UNDERLINE: u8 = 0b0000_0100;

crates/turborepo-vt100/src/screen.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ const MODE_ALTERNATE_SCREEN: u8 = 0b0000_1000;
88
const MODE_BRACKETED_PASTE: u8 = 0b0001_0000;
99

1010
/// The xterm mouse handling mode currently in use.
11-
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
11+
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq)]
1212
pub enum MouseProtocolMode {
1313
/// Mouse handling is disabled.
14+
#[default]
1415
None,
1516

1617
/// Mouse button events should be reported on button press. Also known as
@@ -34,16 +35,11 @@ pub enum MouseProtocolMode {
3435
// DecLocator,
3536
}
3637

37-
impl Default for MouseProtocolMode {
38-
fn default() -> Self {
39-
Self::None
40-
}
41-
}
42-
4338
/// The encoding to use for the enabled `MouseProtocolMode`.
44-
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
39+
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq)]
4540
pub enum MouseProtocolEncoding {
4641
/// Default single-printable-byte encoding.
42+
#[default]
4743
Default,
4844

4945
/// UTF-8-based encoding.
@@ -54,12 +50,6 @@ pub enum MouseProtocolEncoding {
5450
// Urxvt,
5551
}
5652

57-
impl Default for MouseProtocolEncoding {
58-
fn default() -> Self {
59-
Self::Default
60-
}
61-
}
62-
6353
/// Represents the overall terminal state.
6454
#[derive(Clone, Debug)]
6555
pub struct Screen {

packages/turbo-repository/scripts/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ script_provided_flags="\
1313
for flag in $user_provided_flags; do
1414
if [[ $flag == --target=* ]]; then
1515
target=${flag#*=}
16-
rustup toolchain install nightly-2025-06-20 --target "$target"
16+
rustup toolchain install nightly-2025-09-12 --target "$target"
1717

1818
# For we need to cross-compile some targets with Zig
1919
# Fortunately, napi comes with a `--zig` flag

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[toolchain]
22
# Needs to be copied to `packages/turbo-repository/scripts/build.sh`
3-
channel = "nightly-2025-06-20"
3+
channel = "nightly-2025-09-12"
44
components = ["rustfmt", "clippy"]
55
profile = "minimal"

0 commit comments

Comments
 (0)