Skip to content

Commit 2b6304e

Browse files
authored
Update Rust toolchain to nightly-2025-04-10 (vercel#78039)
Attempts to reland parts of vercel#77054. - Removed `#![feature(extract_if)]` - Removed `#![feature(hash_extract_if)]` - Removed no-op `#[must_use]` - Addressed new clippy violations Test Plan: - [ ] Manual build and deploy
1 parent e985a2b commit 2b6304e

File tree

14 files changed

+28
-43
lines changed

14 files changed

+28
-43
lines changed

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "nightly-2025-02-12"
2+
channel = "nightly-2025-04-10"
33
components = ["rustfmt", "clippy", "rust-analyzer"]
44
profile = "minimal"

turbopack/crates/turbo-static/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ fn resolve_concurrency(
194194

195195
for (ident, references) in dep_tree {
196196
for reference in references {
197+
#[allow(clippy::map_entry)] // This doesn't insert into dep_tree, so entry isn't useful
197198
if !dep_tree.contains_key(&reference.identifier) {
198199
// this is a task that is not in the task list
199200
// so we can't resolve it

turbopack/crates/turbo-tasks-auto-hash-map/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(hash_extract_if)]
2-
31
pub mod map;
42
pub mod set;
53

turbopack/crates/turbo-tasks-fs/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![allow(clippy::needless_return)] // tokio macro-generated code doesn't respect this
22
#![feature(trivial_bounds)]
3-
#![feature(hash_extract_if)]
43
#![feature(min_specialization)]
54
#![feature(iter_advance_by)]
65
#![feature(io_error_more)]

turbopack/crates/turbo-tasks-macros-tests/tests/function/fail_operation_method_self_type.stderr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ error: methods taking `self` are not supported with `operation`
44
13 | fn arbitrary_self_type(self: OperationVc<Self>) -> Vc<()> {
55
| ^^^^^^^^^^^^^^^^^^^^^^^
66

7+
error[E0307]: invalid `self` parameter type: `OperationVc<Foobar>`
8+
--> tests/function/fail_operation_method_self_type.rs:13:34
9+
|
10+
13 | fn arbitrary_self_type(self: OperationVc<Self>) -> Vc<()> {
11+
| ^^^^^^^^^^^^^^^^^
12+
|
13+
= note: type of `self` must be `Self` or some type implementing `Receiver`
14+
= help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box<Self>`, `self: Rc<Self>`, or `self: Arc<Self>`
15+
716
error[E0277]: the trait bound `fn(...) -> ... {...::arbitrary_self_type_turbo_tasks_function_inline}: IntoTaskFnWithThis<_, _, _>` is not satisfied
817
--> tests/function/fail_operation_method_self_type.rs:10:1
918
|
@@ -22,12 +31,3 @@ note: required by a bound in `NativeFunction::new_method`
2231
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `NativeFunction::new_method`
2332
= note: consider using `--verbose` to print the full type name to the console
2433
= note: this error originates in the attribute macro `turbo_tasks::value_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
25-
26-
error[E0307]: invalid `self` parameter type: `OperationVc<Foobar>`
27-
--> tests/function/fail_operation_method_self_type.rs:13:34
28-
|
29-
13 | fn arbitrary_self_type(self: OperationVc<Self>) -> Vc<()> {
30-
| ^^^^^^^^^^^^^^^^^
31-
|
32-
= note: type of `self` must be `Self` or some type implementing `Receiver`
33-
= help: consider changing to `self`, `&self`, `&mut self`, or a type implementing `Receiver` such as `self: Box<Self>`, `self: Rc<Self>`, or `self: Arc<Self>`

turbopack/crates/turbo-tasks-memory/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(hash_extract_if)]
21
#![feature(type_alias_impl_trait)]
32
#![feature(box_patterns)]
43
#![feature(int_roundings)]

turbopack/crates/turbo-tasks/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#![feature(trivial_bounds)]
3030
#![feature(min_specialization)]
3131
#![feature(try_trait_v2)]
32-
#![feature(hash_extract_if)]
3332
#![deny(unsafe_op_in_unsafe_fn)]
3433
#![feature(result_flattening)]
3534
#![feature(error_generic_member_access)]

turbopack/crates/turbopack-css/src/process.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ impl StyleSheetLike<'_, '_> {
112112
pub struct UnresolvedUrlReferences(pub Vec<(String, ResolvedVc<UrlAssetReference>)>);
113113

114114
#[turbo_tasks::value(shared, serialization = "none", eq = "manual", cell = "new")]
115+
#[allow(clippy::large_enum_variant)] // This is a turbo-tasks value
115116
pub enum ParseCssResult {
116117
Ok {
117118
code: ResolvedVc<FileContent>,

turbopack/crates/turbopack-dev-server/src/http.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::io::{Error, ErrorKind};
2-
31
use anyhow::{anyhow, Result};
42
use auto_hash_map::AutoSet;
53
use futures::{StreamExt, TryStreamExt};
@@ -177,10 +175,7 @@ pub async fn process_request_with_content_source(
177175
header_map.insert(CONTENT_ENCODING, HeaderValue::from_static("gzip"));
178176

179177
// Grab ropereader stream, coerce anyhow::Error to std::io::Error
180-
let stream_ext = content
181-
.read()
182-
.into_stream()
183-
.map_err(|err| Error::new(ErrorKind::Other, err));
178+
let stream_ext = content.read().into_stream().map_err(std::io::Error::other);
184179

185180
let gzipped_stream =
186181
ReaderStream::new(async_compression::tokio::bufread::GzipEncoder::new(

turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,10 +1516,9 @@ impl VisitAstPath for Analyzer<'_> {
15161516
decl: &'ast FnDecl,
15171517
ast_path: &mut AstNodePath<AstParentNodeRef<'r>>,
15181518
) {
1519-
let old = replace(
1520-
&mut self.cur_fn_return_values,
1521-
Some(get_fn_init_return_vals(decl.function.body.as_ref())),
1522-
);
1519+
let old = self
1520+
.cur_fn_return_values
1521+
.replace(get_fn_init_return_vals(decl.function.body.as_ref()));
15231522
let old_ident = self.cur_fn_ident;
15241523
self.cur_fn_ident = decl.function.span.lo.0;
15251524
decl.visit_children_with_ast_path(self, ast_path);
@@ -1540,10 +1539,9 @@ impl VisitAstPath for Analyzer<'_> {
15401539
expr: &'ast FnExpr,
15411540
ast_path: &mut AstNodePath<AstParentNodeRef<'r>>,
15421541
) {
1543-
let old = replace(
1544-
&mut self.cur_fn_return_values,
1545-
Some(get_fn_init_return_vals(expr.function.body.as_ref())),
1546-
);
1542+
let old = self
1543+
.cur_fn_return_values
1544+
.replace(get_fn_init_return_vals(expr.function.body.as_ref()));
15471545
let old_ident = self.cur_fn_ident;
15481546
self.cur_fn_ident = expr.function.span.lo.0;
15491547
expr.visit_children_with_ast_path(self, ast_path);

0 commit comments

Comments
 (0)