Skip to content

Commit cf82d78

Browse files
chore(core): bump Rust toolchain to 1.94.0 and fix all warnings (#35021)
## Current Behavior Rust toolchain is pinned to 1.90.0 (4 versions behind stable). Building the native code produces 23 compiler warnings (elided lifetimes, unused imports, dead code). ## Expected Behavior Rust toolchain is updated to 1.94.0 (latest stable). Native code compiles with zero warnings. ## Related Issue(s) N/A — maintenance/hygiene change. ### Changes - **`rust-toolchain.toml`**: 1.90.0 → 1.94.0 - **Glob parser**: Fixed 19 elided lifetime warnings via `cargo fix` - **`task_hasher.rs`**: Removed unused `anyhow::anyhow` import - **`command.rs`**: Removed unnecessary `mut` - **`hash_plan_inspector.rs`**: Removed unused `project_graph` field and constructor parameter - **`hash-plan-inspector.ts`**: Updated TS caller to match new native constructor signature - **`index.d.ts`**: Updated generated types to reflect removed parameter --------- Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
1 parent c8ddfed commit cf82d78

14 files changed

Lines changed: 33 additions & 35 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"preinstall": "node ./scripts/preinstall.js",
2424
"test": "nx run-many -t test",
2525
"e2e": "nx run-many -t e2e --projects ./e2e/*",
26-
"build:wasm": "RUSTUP_TOOLCHAIN=nightly-2025-05-09 rustup target add wasm32-wasip1-threads && RUSTUP_TOOLCHAIN=nightly-2025-05-09 WASI_SDK_PATH=\"$(pwd)/wasi-sdk-23.0-x86_64-linux\" CMAKE_BUILD_PARALLEL_LEVEL=2 LIBSQLITE3_FLAGS=\"-DLONGDOUBLE_TYPE=double\" pnpm exec nx run-many -t build-native-wasm",
26+
"build:wasm": "RUSTUP_TOOLCHAIN=nightly-2026-03-01 rustup target add wasm32-wasip1-threads && RUSTUP_TOOLCHAIN=nightly-2026-03-01 WASI_SDK_PATH=\"$(pwd)/wasi-sdk-23.0-x86_64-linux\" CMAKE_BUILD_PARALLEL_LEVEL=2 LIBSQLITE3_FLAGS=\"-DLONGDOUBLE_TYPE=double\" pnpm exec nx run-many -t build-native-wasm",
2727
"lint-pnpm-lock": "eslint pnpm-lock.yaml",
2828
"migrate-to-pnpm-version": "node ./scripts/migrate-to-pnpm-version.js",
2929
"analyze-docs": "node tools/scripts/analyze-docs.mjs",

packages/nx/src/hasher/hash-plan-inspector.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export class HashPlanInspector {
4949
);
5050
this.inspector = new NativeHashPlanInspector(
5151
externalReferences.allWorkspaceFiles,
52-
this.projectGraphRef,
5352
externalReferences.projectFiles,
5453
this.workspaceRootPath
5554
);

packages/nx/src/native/db/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl NxDbConnection {
7777
}
7878
}
7979

80-
pub fn prepare(&self, sql: &str) -> Result<Statement> {
80+
pub fn prepare(&self, sql: &str) -> Result<Statement<'_>> {
8181
if let Some(conn) = &self.conn {
8282
retry_db_operation_when_busy!(conn.prepare(sql))
8383
.map_err(|e| anyhow::anyhow!("DB prepare error: \"{}\", {:?}", sql, e))

packages/nx/src/native/glob.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl NxGlobSet {
8484

8585
fn potential_glob_split(
8686
glob: &str,
87-
) -> itertools::Either<std::str::Split<char>, std::iter::Once<&str>> {
87+
) -> itertools::Either<std::str::Split<'_, char>, std::iter::Once<&str>> {
8888
use itertools::Either::*;
8989
if glob.starts_with('{') && glob.ends_with('}') {
9090
Left(glob.trim_matches('{').trim_end_matches('}').split(','))

packages/nx/src/native/glob/glob_parser.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,72 +26,72 @@ fn special_char_with_no_group(input: &str) -> IResult<&str, &str, VerboseError<&
2626
})(input)
2727
}
2828

29-
fn simple_group(input: &str) -> IResult<&str, GlobGroup, VerboseError<&str>> {
29+
fn simple_group(input: &str) -> IResult<&str, GlobGroup<'_>, VerboseError<&str>> {
3030
context(
3131
"simple_group",
3232
map(preceded(tag("("), group), GlobGroup::NonSpecialGroup),
3333
)(input)
3434
}
3535

36-
fn zero_or_more_group(input: &str) -> IResult<&str, GlobGroup, VerboseError<&str>> {
36+
fn zero_or_more_group(input: &str) -> IResult<&str, GlobGroup<'_>, VerboseError<&str>> {
3737
context(
3838
"zero_or_more_group",
3939
map(preceded(tag("*("), group), GlobGroup::ZeroOrMore),
4040
)(input)
4141
}
4242

43-
fn zero_or_one_group(input: &str) -> IResult<&str, GlobGroup, VerboseError<&str>> {
43+
fn zero_or_one_group(input: &str) -> IResult<&str, GlobGroup<'_>, VerboseError<&str>> {
4444
context(
4545
"zero_or_one_group",
4646
map(preceded(tag("?("), group), GlobGroup::ZeroOrOne),
4747
)(input)
4848
}
4949

50-
fn one_or_more_group(input: &str) -> IResult<&str, GlobGroup, VerboseError<&str>> {
50+
fn one_or_more_group(input: &str) -> IResult<&str, GlobGroup<'_>, VerboseError<&str>> {
5151
context(
5252
"one_or_more_group",
5353
map(preceded(tag("+("), group), GlobGroup::OneOrMore),
5454
)(input)
5555
}
5656

57-
fn brace_group_with_empty_item(input: &str) -> IResult<&str, GlobGroup, VerboseError<&str>> {
57+
fn brace_group_with_empty_item(input: &str) -> IResult<&str, GlobGroup<'_>, VerboseError<&str>> {
5858
context(
5959
"brace_group_with_empty_item",
6060
map(preceded(tag("{,"), brace_group), GlobGroup::ZeroOrOne),
6161
)(input)
6262
}
6363

64-
fn exact_one_group(input: &str) -> IResult<&str, GlobGroup, VerboseError<&str>> {
64+
fn exact_one_group(input: &str) -> IResult<&str, GlobGroup<'_>, VerboseError<&str>> {
6565
context(
6666
"exact_one_group",
6767
map(preceded(tag("@("), group), GlobGroup::ExactOne),
6868
)(input)
6969
}
7070

71-
fn negated_group(input: &str) -> IResult<&str, GlobGroup, VerboseError<&str>> {
71+
fn negated_group(input: &str) -> IResult<&str, GlobGroup<'_>, VerboseError<&str>> {
7272
context(
7373
"negated_group",
7474
map(preceded(tag("!("), group), GlobGroup::Negated),
7575
)(input)
7676
}
7777

78-
fn negated_file_group(input: &str) -> IResult<&str, GlobGroup, VerboseError<&str>> {
78+
fn negated_file_group(input: &str) -> IResult<&str, GlobGroup<'_>, VerboseError<&str>> {
7979
context("negated_file_group", |input| {
8080
let (input, result) = preceded(tag("!("), group)(input)?;
8181
let (input, _) = tag(".")(input)?;
8282
Ok((input, GlobGroup::NegatedFileName(result)))
8383
})(input)
8484
}
8585

86-
fn negated_wildcard(input: &str) -> IResult<&str, GlobGroup, VerboseError<&str>> {
86+
fn negated_wildcard(input: &str) -> IResult<&str, GlobGroup<'_>, VerboseError<&str>> {
8787
context("negated_wildcard", |input| {
8888
let (input, result) = preceded(tag("!("), group)(input)?;
8989
let (input, _) = tag("*")(input)?;
9090
Ok((input, GlobGroup::NegatedWildcard(result)))
9191
})(input)
9292
}
9393

94-
fn non_special_character(input: &str) -> IResult<&str, GlobGroup, VerboseError<&str>> {
94+
fn non_special_character(input: &str) -> IResult<&str, GlobGroup<'_>, VerboseError<&str>> {
9595
context(
9696
"non_special_character",
9797
map(
@@ -105,21 +105,21 @@ fn non_special_character(input: &str) -> IResult<&str, GlobGroup, VerboseError<&
105105
)(input)
106106
}
107107

108-
fn group(input: &str) -> IResult<&str, Cow<str>, VerboseError<&str>> {
108+
fn group(input: &str) -> IResult<&str, Cow<'_, str>, VerboseError<&str>> {
109109
context(
110110
"group",
111111
map_parser(terminated(take_until(")"), tag(")")), separated_group_items),
112112
)(input)
113113
}
114114

115-
fn brace_group(input: &str) -> IResult<&str, Cow<str>, VerboseError<&str>> {
115+
fn brace_group(input: &str) -> IResult<&str, Cow<'_, str>, VerboseError<&str>> {
116116
context(
117117
"brace_group",
118118
map_parser(terminated(take_until("}"), tag("}")), separated_group_items),
119119
)(input)
120120
}
121121

122-
fn separated_group_items(input: &str) -> IResult<&str, Cow<str>, VerboseError<&str>> {
122+
fn separated_group_items(input: &str) -> IResult<&str, Cow<'_, str>, VerboseError<&str>> {
123123
map(
124124
separated_list0(
125125
alt((tag("|"), tag(","))),
@@ -135,7 +135,7 @@ fn separated_group_items(input: &str) -> IResult<&str, Cow<str>, VerboseError<&s
135135
)(input)
136136
}
137137

138-
fn parse_segment(input: &str) -> IResult<&str, Vec<GlobGroup>, VerboseError<&str>> {
138+
fn parse_segment(input: &str) -> IResult<&str, Vec<GlobGroup<'_>>, VerboseError<&str>> {
139139
context(
140140
"parse_segment",
141141
many_till(
@@ -166,7 +166,7 @@ fn parse_segment(input: &str) -> IResult<&str, Vec<GlobGroup>, VerboseError<&str
166166
.map(|(i, (groups, _))| (i, groups))
167167
}
168168

169-
fn separated_segments(input: &str) -> IResult<&str, Vec<Vec<GlobGroup>>, VerboseError<&str>> {
169+
fn separated_segments(input: &str) -> IResult<&str, Vec<Vec<GlobGroup<'_>>>, VerboseError<&str>> {
170170
separated_list0(tag("/"), map_parser(take_till(|c| c == '/'), parse_segment))(input)
171171
}
172172

@@ -183,7 +183,7 @@ fn negated_glob(input: &str) -> (&str, bool) {
183183
}
184184
}
185185

186-
pub fn parse_glob(input: &str) -> anyhow::Result<(bool, Vec<Vec<GlobGroup>>)> {
186+
pub fn parse_glob(input: &str) -> anyhow::Result<(bool, Vec<Vec<GlobGroup<'_>>>)> {
187187
let (input, negated) = negated_glob(input);
188188
let result = separated_segments(input).finish();
189189
if let Ok((_, result)) = result {

packages/nx/src/native/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export declare class FileLock {
4848
}
4949

5050
export declare class HashPlanInspector {
51-
constructor(allWorkspaceFiles: ExternalObject<Array<FileData>>, projectGraph: ExternalObject<ProjectGraph>, projectFileMap: ExternalObject<Record<string, Array<FileData>>>, workspaceRoot: string)
51+
constructor(allWorkspaceFiles: ExternalObject<Array<FileData>>, projectFileMap: ExternalObject<Record<string, Array<FileData>>>, workspaceRoot: string)
5252
/** @deprecated Use `inspectInputs()` instead for structured output. */
5353
inspect(hashPlans: ExternalObject<Record<string, Array<HashInstruction>>>): Record<string, string[]>
5454
/**

packages/nx/src/native/machine_id/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[cfg_attr(target_arch = "wasm32", allow(dead_code))]
12
pub fn get_machine_id() -> String {
23
#[cfg(not(target_arch = "wasm32"))]
34
return machine_uid::get().unwrap_or(String::from("machine"));

packages/nx/src/native/tasks/hash_plan_inspector.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use crate::native::project_graph::types::ProjectGraph;
21
use crate::native::tasks::hashers::{
32
hash_project_files_with_inputs, hash_workspace_files_with_inputs, resolve_task_output_files,
43
};
@@ -14,7 +13,6 @@ use std::sync::Arc;
1413
#[napi]
1514
pub struct HashPlanInspector {
1615
all_workspace_files: Arc<Vec<FileData>>,
17-
project_graph: Arc<ProjectGraph>,
1816
project_file_map: Arc<HashMap<String, Vec<FileData>>>,
1917
workspace_root: String,
2018
}
@@ -26,16 +24,12 @@ impl HashPlanInspector {
2624
#[napi(ts_arg_type = "ExternalObject<Array<FileData>>")] all_workspace_files: &External<
2725
Arc<Vec<FileData>>,
2826
>,
29-
#[napi(ts_arg_type = "ExternalObject<ProjectGraph>")] project_graph: &External<
30-
Arc<ProjectGraph>,
31-
>,
3227
#[napi(ts_arg_type = "ExternalObject<Record<string, Array<FileData>>>")]
3328
project_file_map: &External<Arc<HashMap<String, Vec<FileData>>>>,
3429
workspace_root: String,
3530
) -> Self {
3631
Self {
3732
all_workspace_files: Arc::clone(all_workspace_files),
38-
project_graph: Arc::clone(project_graph),
3933
project_file_map: Arc::clone(project_file_map),
4034
workspace_root,
4135
}

packages/nx/src/native/tasks/task_hasher.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use crate::native::{
2323
types::FileData,
2424
workspace::types::ProjectFiles,
2525
};
26-
use anyhow::anyhow;
2726
use dashmap::DashMap;
2827
use napi::bindgen_prelude::*;
2928
use rayon::prelude::*;

packages/nx/src/native/tui/components/tasks_list.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2359,7 +2359,7 @@ impl TasksList {
23592359
column_visibility: &ColumnVisibility,
23602360
selected_style: Style,
23612361
normal_style: Style,
2362-
) -> Row {
2362+
) -> Row<'_> {
23632363
let status_cell = {
23642364
let mut spans = Self::render_status_prefix(is_selected, is_in_parallel_section);
23652365

@@ -2420,7 +2420,7 @@ impl TasksList {
24202420
column_visibility: &ColumnVisibility,
24212421
selected_style: Style,
24222422
normal_style: Style,
2423-
) -> Row {
2423+
) -> Row<'_> {
24242424
let status_cell =
24252425
self.render_task_status_cell(task, is_selected, show_vertical_line, trailing_spaces);
24262426
let name = self.render_name_cell(task_name.clone(), &task_name, indent_name);

0 commit comments

Comments
 (0)