Skip to content

Commit

Permalink
Update rust toolchain to nightly-2023-09-21 (vercel/turborepo#6002)
Browse files Browse the repository at this point in the history
This:

- Updates to the latest api change for `StdError` in
`error_generic_member_access` rust-lang/rust#99301
- Updates `pathfinder_simd` for compatiblity
- Updates other crates for compatibility with Next.js


Closes WEB-1635
  • Loading branch information
wbinnssmith authored Sep 22, 2023
1 parent bad99c6 commit f987de0
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 42 deletions.
1 change: 1 addition & 0 deletions crates/turbo-tasks-macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(internal_features)]
#![feature(proc_macro_diagnostic)]
#![feature(allow_internal_unstable)]
#![feature(box_patterns)]
Expand Down
15 changes: 9 additions & 6 deletions crates/turbo-tasks/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{
any::Any,
borrow::Cow,
fmt,
fmt::{Debug, Display},
fmt::{Debug, Display, Write},
future::Future,
pin::Pin,
sync::Arc,
Expand Down Expand Up @@ -383,11 +383,14 @@ impl PersistentTaskType {
}
Err(name) => {
if !this_value.has_trait(trait_type) {
let traits = this_value
.traits()
.iter()
.map(|t| format!(" {}", t))
.collect::<String>();
let traits =
this_value
.traits()
.iter()
.fold(String::new(), |mut out, t| {
let _ = write!(out, " {}", t);
out
});
Err(anyhow!(
"{} doesn't implement {} (only{})",
this_value,
Expand Down
1 change: 0 additions & 1 deletion crates/turbo-tasks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#![deny(unsafe_op_in_unsafe_fn)]
#![feature(result_flattening)]
#![feature(error_generic_member_access)]
#![feature(provide_any)]
#![feature(new_uninit)]
#![feature(arbitrary_self_types)]
#![feature(async_fn_in_trait)]
Expand Down
2 changes: 1 addition & 1 deletion crates/turbo-tasks/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ pub fn with_turbo_tasks<T>(func: impl FnOnce(&Arc<dyn TurboTasksApi>) -> T) -> T
}

pub fn weak_turbo_tasks() -> Weak<dyn TurboTasksApi> {
TURBO_TASKS.with(|arc| Arc::downgrade(arc))
TURBO_TASKS.with(Arc::downgrade)
}

pub fn with_turbo_tasks_for_testing<T>(
Expand Down
2 changes: 1 addition & 1 deletion crates/turbo-tasks/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl StdError for SharedError {
self.inner.source()
}

fn provide<'a>(&'a self, req: &mut std::any::Demand<'a>) {
fn provide<'a>(&'a self, req: &mut std::error::Request<'a>) {
self.inner.provide(req);
}
}
Expand Down
12 changes: 3 additions & 9 deletions crates/turbopack-cli-utils/src/issue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,15 +397,9 @@ impl IssueReporter for ConsoleUi {
let category = &plain_issue.category;
let title = &plain_issue.title;
let processing_path = &*plain_issue.processing_path;
let severity_map = grouped_issues
.entry(severity)
.or_insert_with(Default::default);
let category_map = severity_map
.entry(category.clone())
.or_insert_with(Default::default);
let issues = category_map
.entry(context_path.to_string())
.or_insert_with(Default::default);
let severity_map = grouped_issues.entry(severity).or_default();
let category_map = severity_map.entry(category.clone()).or_default();
let issues = category_map.entry(context_path.to_string()).or_default();

let mut styled_issue = if let Some(source) = &plain_issue.source {
let mut styled_issue = format!(
Expand Down
2 changes: 1 addition & 1 deletion crates/turbopack-convert-trace/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ fn main() {
);
add_to_span_counter();
} else {
let group = groups.entry(key).or_insert_with(Vec::new);
let group = groups.entry(key).or_default();
if !group.is_empty() {
add_to_span_counter();
}
Expand Down
2 changes: 1 addition & 1 deletion crates/turbopack-core/src/issue/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ impl CapturedIssues {
})
.try_join()
.await?;
list.sort_by(|a, b| ReadRef::ptr_cmp(a, b));
list.sort_by(ReadRef::ptr_cmp);
Ok(list)
}
}
Expand Down
21 changes: 9 additions & 12 deletions crates/turbopack-dev/src/ecmascript/list/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,15 @@ impl EcmascriptDevChunkListContent {

let by_merger = by_merger
.into_iter()
.map(|(merger, contents)| {
let merger = merger;
async move {
Ok((
merger,
merger
.merge(Vc::cell(contents))
.version()
.into_trait_ref()
.await?,
))
}
.map(|(merger, contents)| async move {
Ok((
merger,
merger
.merge(Vc::cell(contents))
.version()
.into_trait_ref()
.await?,
))
})
.try_join()
.await?
Expand Down
18 changes: 9 additions & 9 deletions crates/turbopack-ecmascript/src/analyzer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::{
borrow::Cow,
cmp::Ordering,
fmt::Display,
fmt::{Display, Write},
future::Future,
hash::{Hash, Hasher},
mem::take,
Expand Down Expand Up @@ -1044,10 +1044,10 @@ impl JsValue {
let explainer = pretty_join(&args, 0, ", ", ",", "");
(
explainer,
hints
.into_iter()
.map(|h| format!("\n{h}"))
.collect::<String>(),
hints.into_iter().fold(String::new(), |mut out, h| {
let _ = write!(out, "\n{h}");
out
}),
)
}

Expand All @@ -1056,10 +1056,10 @@ impl JsValue {
let explainer = self.explain_internal(&mut hints, 0, depth, unknown_depth);
(
explainer,
hints
.into_iter()
.map(|h| format!("\n{h}"))
.collect::<String>(),
hints.into_iter().fold(String::new(), |mut out, h| {
let _ = write!(out, "\n{h}");
out
}),
)
}

Expand Down
2 changes: 1 addition & 1 deletion xtask/src/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ pub fn run_bump(names: HashSet<String>, dry_run: bool) {
.collect::<Vec<PackageJson>>();
let mut workspaces_to_bump = workspaces
.iter()
.filter(|&p| names.contains(&p.name))
.cloned()
.filter(|p| names.contains(&p.name))
.collect::<Vec<_>>();
if workspaces_to_bump.is_empty() {
fn name_to_title(package: &PackageJson) -> String {
Expand Down

0 comments on commit f987de0

Please sign in to comment.