Skip to content

Commit

Permalink
Update rust toolchain to nightly-2023-09-21 (#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 and Zertsov committed Sep 27, 2023
1 parent 6cfa15e commit b1ff9f4
Show file tree
Hide file tree
Showing 20 changed files with 53 additions and 91 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ rustflags = [
# Clippy's needless mut lint is buggy: https://github.com/rust-lang/rust-clippy/issues/11299
"-Aclippy::needless_pass_by_ref_mut",
# Clippy's partial_eq lint is buggy: https://github.com/rust-lang/rust-clippy/issues/11178
"-Aclippy::incorrect_partial_ord_impl_on_ord_type",
"-Aclippy::non_canonical_partial_ord_impl",
]
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ jobs:

- name: Run cargo clippy
run: |
RUSTFLAGS="-D warnings -A deprecated -Aclippy::too_many_arguments -Aclippy::needless_pass_by_ref_mut -Aclippy::incorrect_partial_ord_impl_on_ord_type" cargo groups clippy turbopack --features rustls-tls
RUSTFLAGS="-D warnings -A deprecated -Aclippy::too_many_arguments -Aclippy::needless_pass_by_ref_mut -Aclippy::non_canonical_partial_ord_impl" cargo groups clippy turbopack --features rustls-tls
- name: Run ast-grep lints
run: |
Expand Down
53 changes: 13 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ sourcemap = "6.0.2"
syn = "1.0.107"
tempfile = "3.3.0"
test-case = "3.0.0"
# pinned due to 1.0.45 requiring toolchain update
thiserror = "<1.0.45"
thiserror = "1.0.48"
tiny-gradient = "0.1.0"
tokio = "1.25.0"
tokio-util = { version = "0.7.7", features = ["io"] }
Expand Down
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
1 change: 0 additions & 1 deletion crates/turborepo-api-client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(async_closure)]
#![feature(provide_any)]
#![feature(error_generic_member_access)]
#![deny(clippy::all)]

Expand Down
1 change: 0 additions & 1 deletion crates/turborepo-cache/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(error_generic_member_access)]
#![feature(provide_any)]
#![feature(assert_matches)]
#![feature(box_patterns)]
#![deny(clippy::all)]
Expand Down
1 change: 0 additions & 1 deletion crates/turborepo-lib/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![feature(assert_matches)]
#![feature(box_patterns)]
#![feature(error_generic_member_access)]
#![feature(provide_any)]
#![feature(hash_extract_if)]
#![feature(option_get_or_insert_default)]
#![feature(once_cell_try)]
Expand Down
1 change: 0 additions & 1 deletion crates/turborepo-scm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(error_generic_member_access)]
#![feature(provide_any)]
#![feature(assert_matches)]
#![deny(clippy::all)]

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2023-07-21
nightly-2023-09-21
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 b1ff9f4

Please sign in to comment.