Skip to content

Commit a6e6f70

Browse files
authored
Revert "Update rust toolchain to 2025-03-12" (#77103)
Reverts #77054 Looks like this breaks lld on macOS Intel.
1 parent 8745633 commit a6e6f70

File tree

14 files changed

+43
-29
lines changed

14 files changed

+43
-29
lines changed

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "nightly-2025-03-12"
2+
channel = "nightly-2025-02-12"
33
components = ["rustfmt", "clippy", "rust-analyzer"]
44
profile = "minimal"

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

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![feature(hash_raw_entry)]
2+
#![feature(hash_extract_if)]
23

34
pub mod map;
45
pub mod set;

turbopack/crates/turbo-tasks-backend/src/backend/operation/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ impl<B: BackingStorage> TaskGuard for TaskGuardImpl<'_, B> {
455455
self.task_id
456456
}
457457

458+
#[must_use]
458459
fn add(&mut self, item: CachedDataItem) -> bool {
459460
self.check_access(item.category());
460461
if !self.backend.should_persist() || self.task_id.is_transient() || !item.is_persistent() {

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

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![allow(clippy::needless_return)] // tokio macro-generated code doesn't respect this
22
#![feature(trivial_bounds)]
3+
#![feature(hash_extract_if)]
34
#![feature(min_specialization)]
45
#![feature(iter_advance_by)]
56
#![feature(io_error_more)]

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@ 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-
167
error[E0277]: the trait bound `fn(...) -> ... {...::arbitrary_self_type_turbo_tasks_function_inline}: IntoTaskFnWithThis<_, _, _>` is not satisfied
178
--> tests/function/fail_operation_method_self_type.rs:10:1
189
|
@@ -31,3 +22,12 @@ note: required by a bound in `NativeFunction::new_method`
3122
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `NativeFunction::new_method`
3223
= note: consider using `--verbose` to print the full type name to the console
3324
= 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

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![feature(hash_extract_if)]
12
#![feature(type_alias_impl_trait)]
23
#![feature(box_patterns)]
34
#![feature(int_roundings)]

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

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#![feature(trivial_bounds)]
3030
#![feature(min_specialization)]
3131
#![feature(try_trait_v2)]
32+
#![feature(hash_extract_if)]
3233
#![deny(unsafe_op_in_unsafe_fn)]
3334
#![feature(result_flattening)]
3435
#![feature(error_generic_member_access)]

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

-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ impl StyleSheetLike<'_, '_> {
113113
pub struct UnresolvedUrlReferences(pub Vec<(String, ResolvedVc<UrlAssetReference>)>);
114114

115115
#[turbo_tasks::value(shared, serialization = "none", eq = "manual", cell = "new")]
116-
#[allow(clippy::large_enum_variant)] // This is a turbo-tasks value
117116
pub enum ParseCssResult {
118117
Ok {
119118
code: ResolvedVc<FileContent>,

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::io::Error;
1+
use std::io::{Error, ErrorKind};
22

33
use anyhow::{anyhow, Result};
44
use auto_hash_map::AutoSet;
@@ -177,7 +177,10 @@ pub async fn process_request_with_content_source(
177177
header_map.insert(CONTENT_ENCODING, HeaderValue::from_static("gzip"));
178178

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

182185
let gzipped_stream =
183186
ReaderStream::new(async_compression::tokio::bufread::GzipEncoder::new(

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

+8-6
Original file line numberDiff line numberDiff line change
@@ -1509,9 +1509,10 @@ impl VisitAstPath for Analyzer<'_> {
15091509
decl: &'ast FnDecl,
15101510
ast_path: &mut AstNodePath<AstParentNodeRef<'r>>,
15111511
) {
1512-
let old = self
1513-
.cur_fn_return_values
1514-
.replace(get_fn_init_return_vals(decl.function.body.as_ref()));
1512+
let old = replace(
1513+
&mut self.cur_fn_return_values,
1514+
Some(get_fn_init_return_vals(decl.function.body.as_ref())),
1515+
);
15151516
let old_ident = self.cur_fn_ident;
15161517
self.cur_fn_ident = decl.function.span.lo.0;
15171518
decl.visit_children_with_ast_path(self, ast_path);
@@ -1532,9 +1533,10 @@ impl VisitAstPath for Analyzer<'_> {
15321533
expr: &'ast FnExpr,
15331534
ast_path: &mut AstNodePath<AstParentNodeRef<'r>>,
15341535
) {
1535-
let old = self
1536-
.cur_fn_return_values
1537-
.replace(get_fn_init_return_vals(expr.function.body.as_ref()));
1536+
let old = replace(
1537+
&mut self.cur_fn_return_values,
1538+
Some(get_fn_init_return_vals(expr.function.body.as_ref())),
1539+
);
15381540
let old_ident = self.cur_fn_ident;
15391541
self.cur_fn_ident = expr.function.span.lo.0;
15401542
expr.visit_children_with_ast_path(self, ast_path);

turbopack/crates/turbopack-ecmascript/src/swc_comments.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ impl Comments for ImmutableComments {
191191
}
192192

193193
pub struct CowComments<'a> {
194-
leading: RefCell<FxHashMap<BytePos, Cow<'a, [Comment]>>>,
195-
trailing: RefCell<FxHashMap<BytePos, Cow<'a, [Comment]>>>,
194+
leading: RefCell<FxHashMap<BytePos, Cow<'a, Vec<Comment>>>>,
195+
trailing: RefCell<FxHashMap<BytePos, Cow<'a, Vec<Comment>>>>,
196196
}
197197

198198
impl<'a> CowComments<'a> {
@@ -202,14 +202,14 @@ impl<'a> CowComments<'a> {
202202
comments
203203
.leading
204204
.iter()
205-
.map(|(&key, value)| (key, Cow::Borrowed(&value[..])))
205+
.map(|(&key, value)| (key, Cow::Borrowed(value)))
206206
.collect(),
207207
),
208208
trailing: RefCell::new(
209209
comments
210210
.trailing
211211
.iter()
212-
.map(|(&key, value)| (key, Cow::Borrowed(&value[..])))
212+
.map(|(&key, value)| (key, Cow::Borrowed(value)))
213213
.collect(),
214214
),
215215
}
@@ -274,7 +274,7 @@ impl Comments for CowComments<'_> {
274274
&self,
275275
pos: swc_core::common::BytePos,
276276
) -> Option<Vec<swc_core::common::comments::Comment>> {
277-
self.leading.borrow().get(&pos).map(|v| (**v).to_vec())
277+
self.leading.borrow().get(&pos).map(|v| (**v).clone())
278278
}
279279

280280
fn add_trailing(
@@ -315,7 +315,7 @@ impl Comments for CowComments<'_> {
315315
&self,
316316
pos: swc_core::common::BytePos,
317317
) -> Option<Vec<swc_core::common::comments::Comment>> {
318-
self.trailing.borrow().get(&pos).map(|v| (**v).to_vec())
318+
self.trailing.borrow().get(&pos).map(|v| (**v).clone())
319319
}
320320

321321
fn add_pure_comment(&self, _pos: swc_core::common::BytePos) {

turbopack/crates/turbopack-ecmascript/src/utils.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,11 @@ where
114114
impl std::io::Write for DisplayWriter<'_, '_> {
115115
fn write(&mut self, bytes: &[u8]) -> std::result::Result<usize, std::io::Error> {
116116
self.f
117-
.write_str(std::str::from_utf8(bytes).map_err(std::io::Error::other)?)
118-
.map_err(std::io::Error::other)?;
117+
.write_str(
118+
std::str::from_utf8(bytes)
119+
.map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err))?,
120+
)
121+
.map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err))?;
119122
Ok(bytes.len())
120123
}
121124

turbopack/crates/turbopack-node/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#![feature(min_specialization)]
22
#![feature(arbitrary_self_types)]
33
#![feature(arbitrary_self_types_pointers)]
4+
#![feature(extract_if)]
45

56
use std::{iter::once, thread::available_parallelism};
67

turbopack/crates/turbopack-trace-server/src/store.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::{
22
cmp::{max, min},
33
env,
4+
mem::replace,
45
num::NonZeroUsize,
56
sync::{atomic::AtomicU64, OnceLock},
67
};
@@ -265,9 +266,9 @@ impl Store {
265266
outdated_spans.insert(span_index);
266267
let span = &mut self.spans[span_index.get()];
267268

268-
let old_parent = &mut span.parent.replace(parent);
269+
let old_parent = replace(&mut span.parent, Some(parent));
269270
let old_parent = if let Some(parent) = old_parent {
270-
outdated_spans.insert(*parent);
271+
outdated_spans.insert(parent);
271272
&mut self.spans[parent.get()]
272273
} else {
273274
&mut self.spans[0]

0 commit comments

Comments
 (0)