diff --git a/Cargo.lock b/Cargo.lock index 289620518d51f..03632b5d29f0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5256,9 +5256,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.59" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" dependencies = [ "unicode-ident", ] diff --git a/cli/internal/ffi/ffi.go b/cli/internal/ffi/ffi.go index f38b1702db35e..7b6eaa6e5d250 100644 --- a/cli/internal/ffi/ffi.go +++ b/cli/internal/ffi/ffi.go @@ -13,7 +13,7 @@ package ffi // #cgo linux,amd64,staticbinary LDFLAGS: -L${SRCDIR} -lturborepo_ffi_linux_amd64 -lunwind // #cgo linux,arm64,!staticbinary LDFLAGS: -L${SRCDIR} -lturborepo_ffi_linux_arm64 -lz // #cgo linux,amd64,!staticbinary LDFLAGS: -L${SRCDIR} -lturborepo_ffi_linux_amd64 -lz -// #cgo windows,amd64 LDFLAGS: -L${SRCDIR} -lturborepo_ffi_windows_amd64 -lole32 -lbcrypt -lws2_32 -luserenv +// #cgo windows,amd64 LDFLAGS: -L${SRCDIR} -lturborepo_ffi_windows_amd64 -lole32 -lbcrypt -lws2_32 -luserenv -lntdll import "C" import ( diff --git a/crates/turbo-tasks-bytes/src/stream.rs b/crates/turbo-tasks-bytes/src/stream.rs index 539f35f11ca7b..602d3b0470abb 100644 --- a/crates/turbo-tasks-bytes/src/stream.rs +++ b/crates/turbo-tasks-bytes/src/stream.rs @@ -15,7 +15,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; /// writer (which can be sent to another thread). As new values are written, any /// pending readers will be woken up to receive the new value. #[derive(Clone, Debug)] -pub struct Stream { +pub struct Stream { inner: Arc>>, } @@ -25,7 +25,7 @@ struct StreamState { pulled: Vec, } -impl Stream { +impl Stream { /// Constructs a new Stream, and immediately closes it with only the passed /// values. pub fn new_closed(pulled: Vec) -> Self { @@ -72,7 +72,7 @@ impl Stream { } } -impl Stream> { +impl Stream> { /// Converts a TryStream into a single value when possible. pub async fn try_into_single(&self) -> Result, E> { let mut stream = self.read(); @@ -99,19 +99,19 @@ pub enum SingleValue { Single(T), } -impl + Send + Unpin + 'static> From for Stream { +impl + Send + Unpin + 'static> From for Stream { fn from(source: S) -> Self { Self::new_open(vec![], Box::new(source)) } } -impl Default for Stream { +impl Default for Stream { fn default() -> Self { Self::new_closed(vec![]) } } -impl PartialEq for Stream { +impl PartialEq for Stream { // A Stream is equal if it's the same internal pointer, or both streams are // closed with equivalent values. fn eq(&self, other: &Self) -> bool { @@ -135,9 +135,9 @@ impl PartialEq for Stream { } } } -impl Eq for Stream {} +impl Eq for Stream {} -impl Serialize for Stream { +impl Serialize for Stream { fn serialize(&self, serializer: S) -> Result { use serde::ser::Error; let lock = self.inner.lock().map_err(Error::custom)?; @@ -151,7 +151,7 @@ impl Serialize for Stream { } } -impl<'de, T: Clone + Deserialize<'de>> Deserialize<'de> for Stream { +impl<'de, T: Clone + Send + Deserialize<'de>> Deserialize<'de> for Stream { fn deserialize>(deserializer: D) -> Result { let data = >::deserialize(deserializer)?; Ok(Stream::new_closed(data)) @@ -168,12 +168,12 @@ impl fmt::Debug for StreamState { /// Implements [StreamTrait] over our Stream. #[derive(Debug)] -pub struct StreamRead { +pub struct StreamRead { index: usize, source: Stream, } -impl StreamTrait for StreamRead { +impl StreamTrait for StreamRead { type Item = T; fn poll_next(self: Pin<&mut Self>, cx: &mut TaskContext<'_>) -> Poll> { diff --git a/crates/turbo-tasks-fs/examples/hash_directory.rs b/crates/turbo-tasks-fs/examples/hash_directory.rs index 2671c090473c1..685c9d501276a 100644 --- a/crates/turbo-tasks-fs/examples/hash_directory.rs +++ b/crates/turbo-tasks-fs/examples/hash_directory.rs @@ -1,5 +1,4 @@ #![feature(trivial_bounds)] -#![feature(once_cell)] #![feature(min_specialization)] use std::{ diff --git a/crates/turbo-tasks-fs/examples/hash_glob.rs b/crates/turbo-tasks-fs/examples/hash_glob.rs index 264ef74326126..7381c8d420973 100644 --- a/crates/turbo-tasks-fs/examples/hash_glob.rs +++ b/crates/turbo-tasks-fs/examples/hash_glob.rs @@ -1,5 +1,4 @@ #![feature(trivial_bounds)] -#![feature(once_cell)] #![feature(min_specialization)] use std::{ diff --git a/crates/turbo-tasks-fs/src/lib.rs b/crates/turbo-tasks-fs/src/lib.rs index 7e51ee1b48bf7..09dc09a09e7bc 100644 --- a/crates/turbo-tasks-fs/src/lib.rs +++ b/crates/turbo-tasks-fs/src/lib.rs @@ -1,5 +1,5 @@ #![feature(trivial_bounds)] -#![feature(hash_drain_filter)] +#![feature(hash_extract_if)] #![feature(min_specialization)] #![feature(iter_advance_by)] #![feature(io_error_more)] @@ -137,7 +137,11 @@ impl DiskWatcher { )); } let Some(parent_path) = path.parent() else { - return Err(err).context(format!("Unable to watch {} (tried up to {})", dir_path.display(), path.display())); + return Err(err).context(format!( + "Unable to watch {} (tried up to {})", + dir_path.display(), + path.display() + )); }; path = parent_path; } @@ -408,7 +412,7 @@ impl DiskFileSystem { for path in paths { let path_key = path_to_key(&path); for (_, invalidators) in - invalidator_map.drain_filter(|key, _| key.starts_with(&path_key)) + invalidator_map.extract_if(|key, _| key.starts_with(&path_key)) { invalidators .into_iter() @@ -667,7 +671,7 @@ impl FileSystem for DiskFileSystem { Ok(LinkContent::Link { target, link_type: { - let mut link_type = LinkType::UNSET; + let mut link_type = Default::default(); if link_path.is_absolute() { link_type |= LinkType::ABSOLUTE; } @@ -1501,8 +1505,9 @@ impl FileContent { let old_meta = extract_disk_access(retry_future(|| old_file.metadata()).await, &path)?; let Some(old_meta) = old_meta else { - // If we failed to get meta, then the old file has been deleted between the handle open. - // In which case, we just pretend the file never existed. + // If we failed to get meta, then the old file has been deleted between the + // handle open. In which case, we just pretend the file never + // existed. return Ok(FileComparison::Create); }; // If the meta is different, we need to rewrite the file to update it. @@ -1540,9 +1545,8 @@ impl FileContent { } bitflags! { - #[derive(Serialize, Deserialize, TraceRawVcs)] + #[derive(Default, Serialize, Deserialize, TraceRawVcs)] pub struct LinkType: u8 { - const UNSET = 0; const DIRECTORY = 0b00000001; const ABSOLUTE = 0b00000010; } diff --git a/crates/turbo-tasks-memory/src/cell.rs b/crates/turbo-tasks-memory/src/cell.rs index 07d4f0b61fdb3..2c6ad3f7aa8e9 100644 --- a/crates/turbo-tasks-memory/src/cell.rs +++ b/crates/turbo-tasks-memory/src/cell.rs @@ -284,9 +284,11 @@ impl Cell { dependent_tasks, .. } => { let dependent_tasks = take(dependent_tasks); - let Cell::Value { content, .. } = replace(self, Cell::TrackedValueless { - dependent_tasks, - }) else { unreachable!() }; + let Cell::Value { content, .. } = + replace(self, Cell::TrackedValueless { dependent_tasks }) + else { + unreachable!() + }; Some(content) } } diff --git a/crates/turbo-tasks-memory/src/lib.rs b/crates/turbo-tasks-memory/src/lib.rs index 72080c065b3a1..7f71d8b7114d5 100644 --- a/crates/turbo-tasks-memory/src/lib.rs +++ b/crates/turbo-tasks-memory/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(hash_drain_filter)] +#![feature(hash_extract_if)] #![feature(option_get_or_insert_default)] #![feature(type_alias_impl_trait)] #![feature(lint_reasons)] diff --git a/crates/turbo-tasks-memory/src/stats.rs b/crates/turbo-tasks-memory/src/stats.rs index a62853736b38d..a2f2c7c3ec8dd 100644 --- a/crates/turbo-tasks-memory/src/stats.rs +++ b/crates/turbo-tasks-memory/src/stats.rs @@ -199,7 +199,7 @@ impl Stats { pub fn merge(&mut self, mut select: impl FnMut(&StatsTaskType, &ExportedTaskStats) -> bool) { let merged: HashMap<_, _> = self .tasks - .drain_filter(|ty, stats| select(ty, stats)) + .extract_if(|ty, stats| select(ty, stats)) .collect(); for stats in self.tasks.values_mut() { diff --git a/crates/turbo-tasks-memory/src/task.rs b/crates/turbo-tasks-memory/src/task.rs index 98f6486c6013b..515ff6aa21a23 100644 --- a/crates/turbo-tasks-memory/src/task.rs +++ b/crates/turbo-tasks-memory/src/task.rs @@ -917,7 +917,11 @@ impl Task { let TaskMetaStateWriteGuard::Full(mut state) = self.state_mut() else { return; }; - let TaskStateType::InProgress { ref mut count_as_finished, .. } = state.state_type else { + let TaskStateType::InProgress { + ref mut count_as_finished, + .. + } = state.state_type + else { return; }; if *count_as_finished { diff --git a/crates/turbo-tasks-memory/src/task/meta_state.rs b/crates/turbo-tasks-memory/src/task/meta_state.rs index 548bcc5441b49..349adf333856a 100644 --- a/crates/turbo-tasks-memory/src/task/meta_state.rs +++ b/crates/turbo-tasks-memory/src/task/meta_state.rs @@ -85,12 +85,14 @@ impl TaskMetaState { // These need to be impl types since there is no way to reference the zero-sized // function item type -type TaskMetaStateAsFull = impl Fn(&TaskMetaState) -> Option<&TaskState>; -type TaskMetaStateAsPartial = impl Fn(&TaskMetaState) -> Option<&PartialTaskState>; -type TaskMetaStateAsUnloaded = impl Fn(&TaskMetaState) -> Option<&UnloadedTaskState>; -type TaskMetaStateAsFullMut = impl Fn(&mut TaskMetaState) -> Option<&mut TaskState>; -type TaskMetaStateAsPartialMut = impl Fn(&mut TaskMetaState) -> Option<&mut PartialTaskState>; -type TaskMetaStateAsUnloadedMut = impl Fn(&mut TaskMetaState) -> Option<&mut UnloadedTaskState>; +pub(super) type TaskMetaStateAsFull = impl Fn(&TaskMetaState) -> Option<&TaskState>; +pub(super) type TaskMetaStateAsPartial = impl Fn(&TaskMetaState) -> Option<&PartialTaskState>; +pub(super) type TaskMetaStateAsUnloaded = impl Fn(&TaskMetaState) -> Option<&UnloadedTaskState>; +pub(super) type TaskMetaStateAsFullMut = impl Fn(&mut TaskMetaState) -> Option<&mut TaskState>; +pub(super) type TaskMetaStateAsPartialMut = + impl Fn(&mut TaskMetaState) -> Option<&mut PartialTaskState>; +pub(super) type TaskMetaStateAsUnloadedMut = + impl Fn(&mut TaskMetaState) -> Option<&mut UnloadedTaskState>; pub(super) enum TaskMetaStateReadGuard<'a> { Full(ReadGuard<'a, TaskMetaState, TaskState, TaskMetaStateAsFull>), diff --git a/crates/turbo-tasks-memory/src/viz/table.rs b/crates/turbo-tasks-memory/src/viz/table.rs index fb9684fb5e857..3eff32cfa9326 100644 --- a/crates/turbo-tasks-memory/src/viz/table.rs +++ b/crates/turbo-tasks-memory/src/viz/table.rs @@ -29,7 +29,7 @@ pub fn wrap_html(table_html: &str) -> String { script = r#"// https://github.com/tofsjonas/sortable document.addEventListener("click",function(b){try{var p=function(a){return v&&a.getAttribute("data-sort-alt")||a.getAttribute("data-sort")||a.innerText},q=function(a,c){a.className=a.className.replace(w,"")+c},e=function(a,c){return a.nodeName===c?a:e(a.parentNode,c)},w=/ dir-(u|d) /,v=b.shiftKey||b.altKey,f=e(b.target,"TH"),r=e(f,"TR"),g=e(r,"TABLE");if(/\bsortable\b/.test(g.className)){var h,d=r.cells;for(b=0;b(func: impl FnOnce() -> T) -> T { TASK_ID_MAPPING.with(|cell| { - let old = std::mem::replace(&mut *cell.borrow_mut(), None); + let old = cell.borrow_mut().take(); let _swap_guard = TemporarySwapGuard(cell, ManuallyDrop::new(old)); func() }) diff --git a/crates/turbo-tasks/src/lib.rs b/crates/turbo-tasks/src/lib.rs index ddfc873fb956b..ee8c9420b84e0 100644 --- a/crates/turbo-tasks/src/lib.rs +++ b/crates/turbo-tasks/src/lib.rs @@ -25,7 +25,7 @@ #![feature(trivial_bounds)] #![feature(min_specialization)] #![feature(try_trait_v2)] -#![feature(hash_drain_filter)] +#![feature(hash_extract_if)] #![deny(unsafe_op_in_unsafe_fn)] #![feature(result_flattening)] #![feature(error_generic_member_access)] diff --git a/crates/turbo-tasks/src/manager.rs b/crates/turbo-tasks/src/manager.rs index 32efb4b6521d4..f5120f09f86a2 100644 --- a/crates/turbo-tasks/src/manager.rs +++ b/crates/turbo-tasks/src/manager.rs @@ -667,9 +667,7 @@ impl TurboTasks { } else { drop(start_listener); } - if timeout.is_zero() - || matches!(tokio::time::timeout(timeout, listener).await, Err(_)) - { + if timeout.is_zero() || tokio::time::timeout(timeout, listener).await.is_err() { // Timeout return None; } diff --git a/crates/turbopack-cli-utils/src/runtime_entry.rs b/crates/turbopack-cli-utils/src/runtime_entry.rs index 4092bdffaf285..9d7b77acac2b2 100644 --- a/crates/turbopack-cli-utils/src/runtime_entry.rs +++ b/crates/turbopack-cli-utils/src/runtime_entry.rs @@ -67,7 +67,7 @@ impl RuntimeEntriesVc { for reference in &self.await? { let resolved_entries = reference.resolve_entry(context).await?; - runtime_entries.extend(resolved_entries.into_iter()); + runtime_entries.extend(&resolved_entries); } Ok(EvaluatableAssetsVc::cell(runtime_entries)) diff --git a/crates/turbopack-core/src/chunk/data.rs b/crates/turbopack-core/src/chunk/data.rs index 9ff473c4369e9..61b5b27a1bac3 100644 --- a/crates/turbopack-core/src/chunk/data.rs +++ b/crates/turbopack-core/src/chunk/data.rs @@ -50,13 +50,16 @@ impl ChunkDataVc { let path = path.to_string(); let Some(output_chunk) = OutputChunkVc::resolve_from(chunk).await? else { - return Ok(ChunkDataOptionVc::cell(Some(ChunkData { - path, - included: Vec::new(), - excluded: Vec::new(), - module_chunks: Vec::new(), - references: AssetReferencesVc::empty(), - }.cell()))); + return Ok(ChunkDataOptionVc::cell(Some( + ChunkData { + path, + included: Vec::new(), + excluded: Vec::new(), + module_chunks: Vec::new(), + references: AssetReferencesVc::empty(), + } + .cell(), + ))); }; let runtime_info = output_chunk.runtime_info().await?; diff --git a/crates/turbopack-core/src/chunk/evaluate.rs b/crates/turbopack-core/src/chunk/evaluate.rs index 5c41eee51e5f8..dfabe6a51be33 100644 --- a/crates/turbopack-core/src/chunk/evaluate.rs +++ b/crates/turbopack-core/src/chunk/evaluate.rs @@ -24,7 +24,10 @@ impl EvaluatableAssetVc { Value::new(ReferenceType::Entry(EntryReferenceSubType::Runtime)), ); let Some(entry) = EvaluatableAssetVc::resolve_from(asset).await? else { - bail!("{} is not a valid evaluated entry", asset.ident().to_string().await?) + bail!( + "{} is not a valid evaluated entry", + asset.ident().to_string().await? + ) }; Ok(entry) } diff --git a/crates/turbopack-core/src/chunk/mod.rs b/crates/turbopack-core/src/chunk/mod.rs index 5727c9a6fc1be..dfe698413f41e 100644 --- a/crates/turbopack-core/src/chunk/mod.rs +++ b/crates/turbopack-core/src/chunk/mod.rs @@ -306,12 +306,20 @@ async fn reference_to_graph_nodes( where I: FromChunkableAsset + Eq + std::hash::Hash + Clone, { - let Some(chunkable_asset_reference) = ChunkableAssetReferenceVc::resolve_from(reference).await? else { - return Ok(vec![(None, ChunkContentGraphNode::ExternalAssetReference(reference))]); + let Some(chunkable_asset_reference) = + ChunkableAssetReferenceVc::resolve_from(reference).await? + else { + return Ok(vec![( + None, + ChunkContentGraphNode::ExternalAssetReference(reference), + )]); }; let Some(chunking_type) = *chunkable_asset_reference.chunking_type().await? else { - return Ok(vec![(None, ChunkContentGraphNode::ExternalAssetReference(reference))]); + return Ok(vec![( + None, + ChunkContentGraphNode::ExternalAssetReference(reference), + )]); }; let result = reference.resolve_reference().await?; @@ -574,7 +582,9 @@ where _phantom: PhantomData, }; - let GraphTraversalResult::Completed(traversal_result) = AdjacencyMap::new().visit(root_edges, visit).await else { + let GraphTraversalResult::Completed(traversal_result) = + AdjacencyMap::new().visit(root_edges, visit).await + else { return Ok(None); }; diff --git a/crates/turbopack-core/src/source_map/source_map_asset.rs b/crates/turbopack-core/src/source_map/source_map_asset.rs index fa5b32b8491b4..a8a1381f8b892 100644 --- a/crates/turbopack-core/src/source_map/source_map_asset.rs +++ b/crates/turbopack-core/src/source_map/source_map_asset.rs @@ -39,7 +39,8 @@ impl Asset for SourceMapAsset { #[turbo_tasks::function] async fn content(&self) -> Result { - let Some(generate_source_map) = GenerateSourceMapVc::resolve_from(&self.asset).await? else { + let Some(generate_source_map) = GenerateSourceMapVc::resolve_from(&self.asset).await? + else { bail!("asset does not support generating source maps") }; let sm = if let Some(sm) = &*generate_source_map.generate_source_map().await? { diff --git a/crates/turbopack-css/src/module_asset.rs b/crates/turbopack-css/src/module_asset.rs index db0bed980d874..a6c2426a67109 100644 --- a/crates/turbopack-css/src/module_asset.rs +++ b/crates/turbopack-css/src/module_asset.rs @@ -304,7 +304,9 @@ impl EcmascriptChunkItem for ModuleChunkItem { continue; }; - let Some(css_module) = ModuleCssAssetVc::resolve_from(resolved_module).await? else { + let Some(css_module) = + ModuleCssAssetVc::resolve_from(resolved_module).await? + else { CssModuleComposesIssue { severity: IssueSeverity::Error.cell(), source: self.module.ident(), diff --git a/crates/turbopack-css/src/util.rs b/crates/turbopack-css/src/util.rs index 8e61cd5731f7d..30041e05218e9 100644 --- a/crates/turbopack-css/src/util.rs +++ b/crates/turbopack-css/src/util.rs @@ -8,11 +8,11 @@ pub fn stringify_js(str: &str) -> String { // // Note that the form feed character is not representable as \f in Rust strings, so // the unicode representation \u{0c} is used. - '\\' => escaped.push_str(r#"\\"#), - '\n' => escaped.push_str(r#"\n"#), - '\r' => escaped.push_str(r#"\r"#), + '\\' => escaped.push_str(r"\\"), + '\n' => escaped.push_str(r"\n"), + '\r' => escaped.push_str(r"\r"), '"' => escaped.push_str(r#"\""#), - '\u{0c}' => escaped.push_str(r#"\f"#), + '\u{0c}' => escaped.push_str(r"\f"), _ => escaped.push(char), } } @@ -36,9 +36,9 @@ mod tests { #[test] fn escapes_backslash() { - assert_eq!(stringify_js(r#"\"#), r#""\\""#); - assert_eq!(stringify_js(r#"\\"#), r#""\\\\""#); - assert_eq!(stringify_js(r#"\n"#), r#""\\n""#); + assert_eq!(stringify_js(r"\"), r#""\\""#); + assert_eq!(stringify_js(r"\\"), r#""\\\\""#); + assert_eq!(stringify_js(r"\n"), r#""\\n""#); } #[test] diff --git a/crates/turbopack-dev/src/chunking_context.rs b/crates/turbopack-dev/src/chunking_context.rs index dcf68b406dbef..fff436def5446 100644 --- a/crates/turbopack-dev/src/chunking_context.rs +++ b/crates/turbopack-dev/src/chunking_context.rs @@ -395,7 +395,7 @@ where .copied() .map(|chunk| chunk.as_chunk()) .chain(css_chunks.iter().copied().map(|chunk| chunk.as_chunk())) - .chain(other_chunks.into_iter()) + .chain(other_chunks) .collect(); Ok(ChunksVc::cell(chunks)) diff --git a/crates/turbopack-dev/src/ecmascript/merged/update.rs b/crates/turbopack-dev/src/ecmascript/merged/update.rs index d09b83ef9d7d2..a040aa2dc59fa 100644 --- a/crates/turbopack-dev/src/ecmascript/merged/update.rs +++ b/crates/turbopack-dev/src/ecmascript/merged/update.rs @@ -172,8 +172,7 @@ pub(super) async fn update_ecmascript_merged_chunk( let mut merged_update = EcmascriptMergedUpdate::default(); for (content, content_ref, output_root, path) in &to_contents { - let Some(chunk_path) = output_root - .get_path_to(path) else { + let Some(chunk_path) = output_root.get_path_to(path) else { continue; }; diff --git a/crates/turbopack-dev/src/ecmascript/optimize.rs b/crates/turbopack-dev/src/ecmascript/optimize.rs index 66a58050f90f5..b58fd1c5d13fc 100644 --- a/crates/turbopack-dev/src/ecmascript/optimize.rs +++ b/crates/turbopack-dev/src/ecmascript/optimize.rs @@ -315,7 +315,7 @@ async fn merge_to_limit( } else { remaining -= chunks.len(); let mut part = merge_by_size(chunks).await?; - merged.extend(part.pop().into_iter()); + merged.extend(part.pop()); fully_merged.append(&mut part); } } @@ -332,7 +332,7 @@ async fn merge_to_limit( // higher-level lifetime error otherwise let some = some.to_vec(); let mut part = merge_by_size(some).await?; - merged.extend(part.pop().into_iter()); + merged.extend(part.pop()); fully_merged.append(&mut part); } } diff --git a/crates/turbopack-ecmascript/src/analyzer/graph.rs b/crates/turbopack-ecmascript/src/analyzer/graph.rs index 8e98c17978edf..3fd5951d0bfe4 100644 --- a/crates/turbopack-ecmascript/src/analyzer/graph.rs +++ b/crates/turbopack-ecmascript/src/analyzer/graph.rs @@ -626,7 +626,7 @@ pub fn as_parent_path_with( ast_path .iter() .map(|n| n.kind()) - .chain([additional].into_iter()) + .chain([additional]) .collect() } diff --git a/crates/turbopack-ecmascript/src/analyzer/mod.rs b/crates/turbopack-ecmascript/src/analyzer/mod.rs index ce19049056f8f..95032051d1972 100644 --- a/crates/turbopack-ecmascript/src/analyzer/mod.rs +++ b/crates/turbopack-ecmascript/src/analyzer/mod.rs @@ -1,3 +1,5 @@ +#![allow(clippy::redundant_closure_call)] + use std::{ borrow::Cow, cmp::Ordering, diff --git a/crates/turbopack-ecmascript/src/analyzer/well_known.rs b/crates/turbopack-ecmascript/src/analyzer/well_known.rs index cdb8006f01812..23005080c8911 100644 --- a/crates/turbopack-ecmascript/src/analyzer/well_known.rs +++ b/crates/turbopack-ecmascript/src/analyzer/well_known.rs @@ -362,7 +362,9 @@ pub async fn require_context_require( let Some(s) = args[0].as_str() else { return Ok(JsValue::unknown( JsValue::call( - Box::new(JsValue::WellKnownFunction(WellKnownFunctionKind::RequireContextRequire(val))), + Box::new(JsValue::WellKnownFunction( + WellKnownFunctionKind::RequireContextRequire(val), + )), args, ), "require.context(...).require() only accepts a single, constant string argument", @@ -371,13 +373,16 @@ pub async fn require_context_require( let map = val.await?; let Some(m) = map.get(s) else { - return Ok(JsValue::unknown( - JsValue::call( - Box::new(JsValue::WellKnownFunction(WellKnownFunctionKind::RequireContextRequire(val))), - args, - ), - "require.context(...).require() can only be called with an argument that's in the context", - )); + return Ok(JsValue::unknown( + JsValue::call( + Box::new(JsValue::WellKnownFunction( + WellKnownFunctionKind::RequireContextRequire(val), + )), + args, + ), + "require.context(...).require() can only be called with an argument that's in the \ + context", + )); }; Ok(JsValue::Module(ModuleValue { @@ -445,7 +450,8 @@ pub async fn require_context_require_resolve( )), args, ), - "require.context(...).resolve() can only be called with an argument that's in the context", + "require.context(...).resolve() can only be called with an argument that's in the \ + context", )); }; diff --git a/crates/turbopack-ecmascript/src/code_gen.rs b/crates/turbopack-ecmascript/src/code_gen.rs index 943261825958a..771771a6decaa 100644 --- a/crates/turbopack-ecmascript/src/code_gen.rs +++ b/crates/turbopack-ecmascript/src/code_gen.rs @@ -70,20 +70,15 @@ pub fn path_to( /// possible visit methods. #[macro_export] macro_rules! create_visitor { - (exact $ast_path:expr, $name:ident($arg:ident: &mut $ty:ident) $b:block) => { - $crate::create_visitor!(__ $ast_path.to_vec(), $name($arg: &mut $ty) $b) - }; - ($ast_path:expr, $name:ident($arg:ident: &mut $ty:ident) $b:block) => { - $crate::create_visitor!(__ $crate::code_gen::path_to(&$ast_path, |n| { - matches!(n, swc_core::ecma::visit::AstParentKind::$ty(_)) - }), $name($arg: &mut $ty) $b) - }; - (__ $ast_path:expr, $name:ident($arg:ident: &mut $ty:ident) $b:block) => {{ - struct Visitor { - $name: T, + // This rule needs to be first, otherwise we run into the following error: + // expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:` + // This is a regression on nightly. + (visit_mut_program($arg:ident: &mut Program) $b:block) => {{ + struct Visitor { + visit_mut_program: T, } - impl $crate::code_gen::VisitorFactory + impl $crate::code_gen::VisitorFactory for Box> { fn create<'a>(&'a self) -> Box { @@ -91,27 +86,35 @@ macro_rules! create_visitor { } } - impl<'a, T: Fn(&mut swc_core::ecma::ast::$ty) + Send + Sync> swc_core::ecma::visit::VisitMut + impl<'a, T: Fn(&mut swc_core::ecma::ast::Program) + Send + Sync> swc_core::ecma::visit::VisitMut for &'a Visitor { - fn $name(&mut self, $arg: &mut swc_core::ecma::ast::$ty) { - (self.$name)($arg); + fn visit_mut_program(&mut self, $arg: &mut swc_core::ecma::ast::Program) { + (self.visit_mut_program)($arg); } } ( - $ast_path, + Vec::new(), Box::new(Box::new(Visitor { - $name: move |$arg: &mut swc_core::ecma::ast::$ty| $b, + visit_mut_program: move |$arg: &mut swc_core::ecma::ast::Program| $b, })) as Box, ) }}; - (visit_mut_program($arg:ident: &mut Program) $b:block) => {{ - struct Visitor { - visit_mut_program: T, + (exact $ast_path:expr, $name:ident($arg:ident: &mut $ty:ident) $b:block) => { + $crate::create_visitor!(__ $ast_path.to_vec(), $name($arg: &mut $ty) $b) + }; + ($ast_path:expr, $name:ident($arg:ident: &mut $ty:ident) $b:block) => { + $crate::create_visitor!(__ $crate::code_gen::path_to(&$ast_path, |n| { + matches!(n, swc_core::ecma::visit::AstParentKind::$ty(_)) + }), $name($arg: &mut $ty) $b) + }; + (__ $ast_path:expr, $name:ident($arg:ident: &mut $ty:ident) $b:block) => {{ + struct Visitor { + $name: T, } - impl $crate::code_gen::VisitorFactory + impl $crate::code_gen::VisitorFactory for Box> { fn create<'a>(&'a self) -> Box { @@ -119,18 +122,18 @@ macro_rules! create_visitor { } } - impl<'a, T: Fn(&mut swc_core::ecma::ast::Program) + Send + Sync> swc_core::ecma::visit::VisitMut + impl<'a, T: Fn(&mut swc_core::ecma::ast::$ty) + Send + Sync> swc_core::ecma::visit::VisitMut for &'a Visitor { - fn visit_mut_program(&mut self, $arg: &mut swc_core::ecma::ast::Program) { - (self.visit_mut_program)($arg); + fn $name(&mut self, $arg: &mut swc_core::ecma::ast::$ty) { + (self.$name)($arg); } } ( - Vec::new(), + $ast_path, Box::new(Box::new(Visitor { - visit_mut_program: move |$arg: &mut swc_core::ecma::ast::Program| $b, + $name: move |$arg: &mut swc_core::ecma::ast::$ty| $b, })) as Box, ) }}; diff --git a/crates/turbopack-ecmascript/src/references/mod.rs b/crates/turbopack-ecmascript/src/references/mod.rs index cebab8e317b85..9776af1a32ead 100644 --- a/crates/turbopack-ecmascript/src/references/mod.rs +++ b/crates/turbopack-ecmascript/src/references/mod.rs @@ -379,7 +379,8 @@ pub(crate) async fn analyze_ecmascript_module( comments, source_map, .. - } = &*parsed else { + } = &*parsed + else { return analysis.build().await; }; @@ -422,7 +423,7 @@ pub(crate) async fn analyze_ecmascript_module( CommentKind::Line => { lazy_static! { static ref SOURCE_MAP_FILE_REFERENCE: Regex = - Regex::new(r#"# sourceMappingURL=(.*?\.map)$"#).unwrap(); + Regex::new(r"# sourceMappingURL=(.*?\.map)$").unwrap(); } if let Some(m) = SOURCE_MAP_FILE_REFERENCE.captures(&comment.text) { let path = &m[1]; diff --git a/crates/turbopack-image/src/process/mod.rs b/crates/turbopack-image/src/process/mod.rs index 35030ed826689..c33000947ce8b 100644 --- a/crates/turbopack-image/src/process/mod.rs +++ b/crates/turbopack-image/src/process/mod.rs @@ -291,7 +291,7 @@ pub async fn get_meta_data( blur_placeholder: Option, ) -> Result { let FileContent::Content(content) = &*content.await? else { - bail!("Input image not found"); + bail!("Input image not found"); }; let bytes = content.content().to_bytes()?; let path = ident.path().await?; @@ -367,7 +367,8 @@ pub async fn optimize( return Ok(FileContent::NotFound.cell()); }; let bytes = content.content().to_bytes()?; - let Some((image, mut format)) = load_image(ident, &bytes, ident.path().await?.extension()) else { + let Some((image, mut format)) = load_image(ident, &bytes, ident.path().await?.extension()) + else { return Ok(FileContent::NotFound.cell()); }; let (width, height) = image.dimensions(); diff --git a/crates/turbopack-image/src/process/svg.rs b/crates/turbopack-image/src/process/svg.rs index 80a18babaf2f6..59956bbbc0715 100644 --- a/crates/turbopack-image/src/process/svg.rs +++ b/crates/turbopack-image/src/process/svg.rs @@ -34,7 +34,7 @@ static HEIGHT_REGEX: Lazy = static VIEW_BOX_REGEX: Lazy = Lazy::new(|| Regex::new(r#"\sviewBox=['"](.+?)['"]"#).unwrap()); static VIEW_BOX_CONTENT_REGEX: Lazy = Lazy::new(|| { - Regex::new(r#"^\s*((?:\w|\.|-)+)\s+((?:\w|\.|-)+)\s+((?:\w|\.|-)+)\s+((?:\w|\.|-)+)\s*$"#) + Regex::new(r"^\s*((?:\w|\.|-)+)\s+((?:\w|\.|-)+)\s+((?:\w|\.|-)+)\s+((?:\w|\.|-)+)\s*$") .unwrap() }); diff --git a/crates/turbopack-node/src/lib.rs b/crates/turbopack-node/src/lib.rs index 3ca91943386b6..ff927fcf56790 100644 --- a/crates/turbopack-node/src/lib.rs +++ b/crates/turbopack-node/src/lib.rs @@ -202,7 +202,7 @@ async fn separate_assets( /// Emit a basic package.json that sets the type of the package to commonjs. /// Currently code generated for Node is CommonJS, while authored code may be /// ESM, for example. -pub(self) fn emit_package_json(dir: FileSystemPathVc) -> CompletionVc { +fn emit_package_json(dir: FileSystemPathVc) -> CompletionVc { emit( VirtualAssetVc::new( dir.join("package.json"), @@ -233,10 +233,16 @@ pub async fn get_renderer_pool( let entrypoint = intermediate_asset.ident().path(); let Some(cwd) = to_sys_path(cwd).await? else { - bail!("can only render from a disk filesystem, but `cwd = {}`", cwd.to_string().await?); + bail!( + "can only render from a disk filesystem, but `cwd = {}`", + cwd.to_string().await? + ); }; let Some(entrypoint) = to_sys_path(entrypoint).await? else { - bail!("can only render from a disk filesystem, but `entrypoint = {}`", entrypoint.to_string().await?); + bail!( + "can only render from a disk filesystem, but `entrypoint = {}`", + entrypoint.to_string().await? + ); }; emit.await?; diff --git a/crates/turbopack-node/src/render/node_api_source.rs b/crates/turbopack-node/src/render/node_api_source.rs index 87fb44e9b0a6c..0711db2d3a77f 100644 --- a/crates/turbopack-node/src/render/node_api_source.rs +++ b/crates/turbopack-node/src/render/node_api_source.rs @@ -128,7 +128,8 @@ impl GetContentSourceContent for NodeApiContentSource { raw_query: Some(raw_query), body: Some(body), .. - } = &*data else { + } = &*data + else { return Err(anyhow!("Missing request data")); }; let entry = self.entry.entry(data.clone()).await?; diff --git a/crates/turbopack-node/src/render/rendered_source.rs b/crates/turbopack-node/src/render/rendered_source.rs index 411e8b991cf37..7dba3925a14b0 100644 --- a/crates/turbopack-node/src/render/rendered_source.rs +++ b/crates/turbopack-node/src/render/rendered_source.rs @@ -187,7 +187,11 @@ impl GetContentSourceContent for NodeRenderContentSource { data: Value, ) -> Result { let Some(params) = &*self.route_match.params(path).await? else { - return Err(anyhow!("Non matching path ({}) provided for {}", path, self.pathname.await?)); + return Err(anyhow!( + "Non matching path ({}) provided for {}", + path, + self.pathname.await? + )); }; let ContentSourceData { method: Some(method), @@ -196,7 +200,8 @@ impl GetContentSourceContent for NodeRenderContentSource { raw_headers: Some(raw_headers), raw_query: Some(raw_query), .. - } = &*data else { + } = &*data + else { return Err(anyhow!("Missing request data")); }; let entry = self.entry.entry(data.clone()).await?; diff --git a/crates/turbopack-node/src/transforms/postcss.rs b/crates/turbopack-node/src/transforms/postcss.rs index a08866c5d9af0..ac2b07fab3527 100644 --- a/crates/turbopack-node/src/transforms/postcss.rs +++ b/crates/turbopack-node/src/transforms/postcss.rs @@ -188,8 +188,9 @@ impl PostCssTransformedAssetVc { let FindContextFileResult::Found(config_path, _) = *find_config_result.await? else { return Ok(ProcessPostCssResult { content: this.source.content(), - assets: Vec::new() - }.cell()) + assets: Vec::new(), + } + .cell()); }; let ExecutionContext { @@ -204,8 +205,9 @@ impl PostCssTransformedAssetVc { let FileContent::Content(content) = &*file.await? else { return Ok(ProcessPostCssResult { content: AssetContent::File(FileContent::NotFound.cell()).cell(), - assets: Vec::new() - }.cell()); + assets: Vec::new(), + } + .cell()); }; let content = content.content().to_str()?; let context = this.evaluate_context; @@ -238,8 +240,9 @@ impl PostCssTransformedAssetVc { // An error happened, which has already been converted into an issue. return Ok(ProcessPostCssResult { content: AssetContent::File(FileContent::NotFound.cell()).cell(), - assets: Vec::new() - }.cell()); + assets: Vec::new(), + } + .cell()); }; let processed_css: PostCssProcessingResult = parse_json_with_source_context(val.to_str()?) .context("Unable to deserializate response from PostCSS transform operation")?; diff --git a/crates/turbopack-node/src/transforms/webpack.rs b/crates/turbopack-node/src/transforms/webpack.rs index 7c68e52e437dc..f7e8fcc8a6487 100644 --- a/crates/turbopack-node/src/transforms/webpack.rs +++ b/crates/turbopack-node/src/transforms/webpack.rs @@ -141,8 +141,9 @@ impl WebpackLoadersProcessedAssetVc { let FileContent::Content(content) = &*file.await? else { return Ok(ProcessWebpackLoadersResult { content: AssetContent::File(FileContent::NotFound.cell()).cell(), - assets: Vec::new() - }.cell()); + assets: Vec::new(), + } + .cell()); }; let content = content.content().to_str()?; let context = transform.evaluate_context; @@ -173,8 +174,9 @@ impl WebpackLoadersProcessedAssetVc { // An error happened, which has already been converted into an issue. return Ok(ProcessWebpackLoadersResult { content: AssetContent::File(FileContent::NotFound.cell()).cell(), - assets: Vec::new() - }.cell()); + assets: Vec::new(), + } + .cell()); }; let processed: WebpackLoadersProcessingResult = parse_json_with_source_context( val.to_str()?, diff --git a/crates/turbopack-tests/tests/execution.rs b/crates/turbopack-tests/tests/execution.rs index 53e4ba1a1b133..2767a68614f47 100644 --- a/crates/turbopack-tests/tests/execution.rs +++ b/crates/turbopack-tests/tests/execution.rs @@ -265,9 +265,10 @@ async fn run_test(resource: &str) -> Result { let SingleValue::Single(bytes) = res .try_into_single() .await - .context("test node result did not emit anything")? else { - panic!("Evaluation stream must yield SingleValue."); - }; + .context("test node result did not emit anything")? + else { + panic!("Evaluation stream must yield SingleValue."); + }; Ok(RunTestResult { js_result: JsResultVc::cell(parse_json_with_source_context(bytes.to_str()?)?), @@ -296,13 +297,9 @@ async fn snapshot_issues(run_result: RunTestResultVc) -> Result { .try_join() .await?; - turbopack_test_utils::snapshot::snapshot_issues( - plain_issues.into_iter(), - path.join("issues"), - &REPO_ROOT, - ) - .await - .context("Unable to handle issues")?; + turbopack_test_utils::snapshot::snapshot_issues(plain_issues, path.join("issues"), &REPO_ROOT) + .await + .context("Unable to handle issues")?; Ok(NothingVc::new()) } diff --git a/crates/turbopack-tests/tests/snapshot.rs b/crates/turbopack-tests/tests/snapshot.rs index d0597183f3635..6af861f6a9257 100644 --- a/crates/turbopack-tests/tests/snapshot.rs +++ b/crates/turbopack-tests/tests/snapshot.rs @@ -159,7 +159,7 @@ async fn run(resource: PathBuf) -> Result<()> { .try_join() .await?; - snapshot_issues(plain_issues.into_iter(), out.join("issues"), &REPO_ROOT) + snapshot_issues(plain_issues, out.join("issues"), &REPO_ROOT) .await .context("Unable to handle issues")?; Ok(NothingVc::new().into()) diff --git a/crates/turbopack/examples/turbopack.rs b/crates/turbopack/examples/turbopack.rs index 3473fbdbc3ae1..af67b1a3cbeca 100644 --- a/crates/turbopack/examples/turbopack.rs +++ b/crates/turbopack/examples/turbopack.rs @@ -1,5 +1,4 @@ #![feature(trivial_bounds)] -#![feature(once_cell)] #![feature(min_specialization)] use std::{ diff --git a/crates/turbopack/src/condition.rs b/crates/turbopack/src/condition.rs index 4b732ece7d25f..3adaf45f9365e 100644 --- a/crates/turbopack/src/condition.rs +++ b/crates/turbopack/src/condition.rs @@ -36,6 +36,8 @@ impl ContextCondition { pub async fn matches(&self, context: &FileSystemPath) -> Result { match self { ContextCondition::All(conditions) => { + // False positive. + #[allow(clippy::manual_try_fold)] stream::iter(conditions) .fold(Ok(true), |acc, c| async move { Ok(acc? && c.matches(context).await?) @@ -43,6 +45,8 @@ impl ContextCondition { .await } ContextCondition::Any(conditions) => { + // False positive. + #[allow(clippy::manual_try_fold)] stream::iter(conditions) .fold(Ok(true), |acc, c| async move { Ok(acc? || c.matches(context).await?) diff --git a/crates/turbopack/src/lib.rs b/crates/turbopack/src/lib.rs index 04a707c346bf3..78f6393132aa5 100644 --- a/crates/turbopack/src/lib.rs +++ b/crates/turbopack/src/lib.rs @@ -3,7 +3,6 @@ #![feature(min_specialization)] #![feature(map_try_insert)] #![feature(option_get_or_insert_default)] -#![feature(once_cell)] #![feature(hash_set_entry)] #![recursion_limit = "256"] diff --git a/crates/turbopack/tests/node-file-trace.rs b/crates/turbopack/tests/node-file-trace.rs index 782e6c722f161..24238e22b4c44 100644 --- a/crates/turbopack/tests/node-file-trace.rs +++ b/crates/turbopack/tests/node-file-trace.rs @@ -1,4 +1,5 @@ #![feature(min_specialization)] +#![allow(clippy::items_after_test_module)] mod helpers; #[cfg(feature = "bench_against_node_nft")] diff --git a/crates/turborepo-cache/src/cache_archive/restore.rs b/crates/turborepo-cache/src/cache_archive/restore.rs index 5d28cc6b6368e..5434dcb840dd9 100644 --- a/crates/turborepo-cache/src/cache_archive/restore.rs +++ b/crates/turborepo-cache/src/cache_archive/restore.rs @@ -155,7 +155,7 @@ impl CacheReader { let key = &graph[node]; let Some(header) = header_lookup.get(key) else { - continue + continue; }; let file = restore_symlink_allow_missing_target(dir_cache, anchor, header)?; restored.push(file); diff --git a/crates/turborepo-globwatch/src/lib.rs b/crates/turborepo-globwatch/src/lib.rs index d4565fca46f8b..f5ff0f7f2ff73 100644 --- a/crates/turborepo-globwatch/src/lib.rs +++ b/crates/turborepo-globwatch/src/lib.rs @@ -18,7 +18,7 @@ unused_must_use, unsafe_code )] -#![feature(drain_filter)] +#![feature(extract_if)] use std::{ collections::HashMap, @@ -198,7 +198,7 @@ impl GlobWatcher { // requestor. flushes should not be considered as events. for flush_id in e .paths - .drain_filter(|p| p.starts_with(flush_dir.as_path())) + .extract_if(|p| p.starts_with(flush_dir.as_path())) .filter_map(|p| { get_flush_id( p.strip_prefix(flush_dir.as_path()) diff --git a/crates/turborepo-lib/src/opts.rs b/crates/turborepo-lib/src/opts.rs index 1c7b19081369c..4268ce0a53aec 100644 --- a/crates/turborepo-lib/src/opts.rs +++ b/crates/turborepo-lib/src/opts.rs @@ -47,7 +47,7 @@ impl<'a> TryFrom<&'a Args> for Opts<'a> { fn try_from(args: &'a Args) -> std::result::Result { let Some(Command::Run(run_args)) = &args.command else { - return Err(anyhow!("Expected run command")) + return Err(anyhow!("Expected run command")); }; let run_opts = RunOpts::try_from(run_args.as_ref())?; let cache_opts = CacheOpts::from(run_args.as_ref()); diff --git a/crates/turborepo-lib/src/package_graph/builder.rs b/crates/turborepo-lib/src/package_graph/builder.rs index 5a537f00d047e..f7c95b06bff79 100644 --- a/crates/turborepo-lib/src/package_graph/builder.rs +++ b/crates/turborepo-lib/src/package_graph/builder.rs @@ -387,11 +387,9 @@ impl<'a> BuildState<'a, ResolvedLockfile> { } fn populate_transitive_dependencies(&mut self) -> Result<(), Error> { - let Some(lockfile) = self - .lockfile - .as_deref() else { - return Ok(()) - }; + let Some(lockfile) = self.lockfile.as_deref() else { + return Ok(()); + }; let mut closures = turborepo_lockfiles::all_transitive_closures( lockfile, diff --git a/crates/turborepo-lib/src/package_manager/mod.rs b/crates/turborepo-lib/src/package_manager/mod.rs index c7f36816ff08b..2b8ef60c4a1de 100644 --- a/crates/turborepo-lib/src/package_manager/mod.rs +++ b/crates/turborepo-lib/src/package_manager/mod.rs @@ -364,7 +364,7 @@ impl PackageManager { // Attempts to read the package manager from the package.json fn read_package_manager(pkg: &PackageJson) -> Result, Error> { let Some(package_manager) = &pkg.package_manager else { - return Ok(None) + return Ok(None); }; let (manager, version) = Self::parse_package_manager_string(package_manager)?; @@ -606,7 +606,7 @@ mod tests { let result = PackageManager::parse_package_manager_string(&case.package_manager); let Ok((received_manager, received_version)) = result else { assert!(case.expected_error, "{}: received error", case.name); - continue + continue; }; assert_eq!(received_manager, case.expected_manager); diff --git a/crates/turborepo-lockfiles/src/pnpm/data.rs b/crates/turborepo-lockfiles/src/pnpm/data.rs index 94ac7156cd5ac..5b50e3f7ab110 100644 --- a/crates/turborepo-lockfiles/src/pnpm/data.rs +++ b/crates/turborepo-lockfiles/src/pnpm/data.rs @@ -214,16 +214,19 @@ impl PnpmLockfile { ) -> Result, crate::Error> { let importer = self.get_workspace(workspace_path)?; - let Some((resolved_specifier, resolved_version)) = importer.dependencies.find_resolution(name) else { + let Some((resolved_specifier, resolved_version)) = + importer.dependencies.find_resolution(name) + else { // Check if the specifier is already an exact version return match self.get_packages(&self.format_key(name, specifier)) { Some(_) => Ok(Some(specifier)), - None => Err(Error::MissingResolvedVersion{ + None => Err(Error::MissingResolvedVersion { name: name.into(), specifier: specifier.into(), workspace: workspace_path.into(), - }.into()), - } + } + .into()), + }; }; let override_specifier = self.apply_overrides(name, specifier); @@ -342,7 +345,7 @@ impl crate::Lockfile for PnpmLockfile { } let Some(resolved_version) = self.resolve_specifier(workspace_path, name, version)? else { - return Ok(None) + return Ok(None); }; let key = self.format_key(name, resolved_version); @@ -377,7 +380,7 @@ impl crate::Lockfile for PnpmLockfile { key: &str, ) -> Result>, crate::Error> { let Some(entry) = self.packages.as_ref().and_then(|pkgs| pkgs.get(key)) else { - return Ok(None) + return Ok(None); }; Ok(Some( entry diff --git a/rust-toolchain b/rust-toolchain index e79845b64a575..cf53f1cbd5227 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2023-03-09 +nightly-2023-07-03 \ No newline at end of file diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 047f55bccaf8b..85bccfe5e8cc7 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -138,7 +138,7 @@ fn main() { let status = process::Command::new("cargo") .arg("upgrade") .arg("--workspace") - .args(only_swc_set.into_iter()) + .args(only_swc_set) .current_dir(&workspace_dir) .stdout(process::Stdio::inherit()) .stderr(process::Stdio::inherit())