Skip to content

Commit

Permalink
Upgrade to rustc nightly-2024-08-01 (#68452)
Browse files Browse the repository at this point in the history
1. Upgrade to `nightly-2024-08-01`
2. Fix lints
3. Remove some unused structs
4. Bump `regex` because of rust-lang/regex#1219

Closes PACK-3178
  • Loading branch information
mischnic authored and ForsakenHarmony committed Aug 14, 2024
1 parent f1786af commit beb9842
Show file tree
Hide file tree
Showing 17 changed files with 15 additions and 45 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ proc-macro2 = "1.0.79"
qstring = "0.7.2"
quote = "1.0.23"
rand = "0.8.5"
regex = "1.7.0"
regex = "1.10.6"
rstest = "0.16.0"
rustc-hash = "1.1.0"
semver = "1.0.16"
Expand Down
17 changes: 0 additions & 17 deletions crates/next-core/src/next_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,12 @@ use crate::{
next_import_map::mdx_import_source_file, next_shared::transforms::ModularizeImportPackageConfig,
};

#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
struct NextConfigAndCustomRoutesRaw {
config: NextConfig,
custom_routes: CustomRoutesRaw,
}

#[turbo_tasks::value]
struct NextConfigAndCustomRoutes {
config: Vc<NextConfig>,
custom_routes: Vc<CustomRoutes>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
struct CustomRoutesRaw {
rewrites: Rewrites,

// unsupported
headers: Vec<Header>,
redirects: Vec<Redirect>,
}

#[turbo_tasks::value]
struct CustomRoutes {
rewrites: Vc<Rewrites>,
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2024-05-31"
channel = "nightly-2024-08-01"
components = ["rustfmt", "clippy"]
profile = "minimal"
3 changes: 1 addition & 2 deletions turbopack/crates/turbo-static/src/call_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ impl<'a> CallResolver<'a> {
bincode::deserialize_from::<_, HashMap<Identifier, Vec<IdentifierReference>>>(
reader,
)
.map_err(|e| {
.inspect_err(|_| {
tracing::warn!("failed to load existing cache, restarting");
e
})
.ok()
})
Expand Down
1 change: 0 additions & 1 deletion turbopack/crates/turbo-tasks-fs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#![feature(io_error_more)]
#![feature(round_char_boundary)]
#![feature(arbitrary_self_types)]
#![feature(lint_reasons)]
#![allow(clippy::mutable_key_type)]

pub mod attach;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ pub fn increase_aggregation_number_internal<C: AggregationContext>(
prepared.apply(ctx, balance_queue);
}

#[allow(dead_code)]
/// A prepared `increase_aggregation_number` operation.
pub struct PreparedIncreaseAggregationNumber<C: AggregationContext>(
PreparedInternalIncreaseAggregationNumber<C>,
Expand Down
1 change: 0 additions & 1 deletion turbopack/crates/turbo-tasks-memory/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![feature(hash_extract_if)]
#![feature(option_get_or_insert_default)]
#![feature(type_alias_impl_trait)]
#![feature(lint_reasons)]
#![feature(box_patterns)]
#![feature(int_roundings)]
#![feature(impl_trait_in_assoc_type)]
Expand Down
4 changes: 1 addition & 3 deletions turbopack/crates/turbo-tasks-memory/src/memory_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,8 @@ impl MemoryBackend {
.get(key)
// Avoid holding the lock for too long
.map(|task_ref| *task_ref)
.map(|task_id| {
.inspect(|&task_id| {
self.connect_task_child(parent_task, task_id, turbo_tasks);

task_id
})
}

Expand Down
8 changes: 4 additions & 4 deletions turbopack/crates/turbo-tasks-memory/tests/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async fn transparent_debug() {
async fn enum_none_debug() {
run(&REGISTRATION, async {
let a: Vc<Enum> = Enum::None.cell();
assert_eq!(format!("{:?}", a.dbg().await.unwrap()), "Enum::None");
assert_eq!(format!("{:?}", a.dbg().await.unwrap()), "Enum :: None");
})
.await
}
Expand All @@ -40,7 +40,7 @@ async fn enum_transparent_debug() {
let a: Vc<Enum> = Enum::Transparent(Transparent(42).cell()).cell();
assert_eq!(
format!("{:?}", a.dbg().await.unwrap()),
r#"Enum::Transparent(
r#"Enum :: Transparent(
42,
)"#
);
Expand All @@ -54,8 +54,8 @@ async fn enum_inner_vc_debug() {
let a: Vc<Enum> = Enum::Enum(Enum::None.cell()).cell();
assert_eq!(
format!("{:?}", a.dbg().await.unwrap()),
r#"Enum::Enum(
Enum::None,
r#"Enum :: Enum(
Enum :: None,
)"#
);
})
Expand Down
1 change: 1 addition & 0 deletions turbopack/crates/turbo-tasks-signposter/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ unsafe impl Send for Log {}
impl Default for Log {
fn default() -> Self {
Log {
#[allow(unused_unsafe)] // This is a false positive lint.
os_log: unsafe { addr_of!(_os_log_default) as *const _ as *mut _ },
}
}
Expand Down
6 changes: 0 additions & 6 deletions turbopack/crates/turbo-tasks/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,6 @@ mod ser {

impl<'de> Deserialize<'de> for PersistentTaskType {
fn deserialize<D: ser::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
#[derive(Deserialize)]
enum VariantKind {
Native,
ResolveNative,
ResolveTrait,
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = PersistentTaskType;
Expand Down
1 change: 0 additions & 1 deletion turbopack/crates/turbopack-browser/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(lint_reasons)]
#![feature(iter_intersperse)]
#![feature(int_roundings)]
#![feature(arbitrary_self_types)]
Expand Down
1 change: 0 additions & 1 deletion turbopack/crates/turbopack-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#![feature(option_get_or_insert_default)]
#![feature(type_alias_impl_trait)]
#![feature(assert_matches)]
#![feature(lint_reasons)]
#![feature(arbitrary_self_types)]
#![feature(iter_intersperse)]

Expand Down
6 changes: 3 additions & 3 deletions turbopack/crates/turbopack-core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ use std::{collections::HashSet, future::Future, hash::Hash, pin::Pin, task::Poll
pub fn _race_pop<'a, T: 'a, F: Future<Output = T> + Unpin>(
futures: &'a mut Vec<F>,
) -> impl Future<Output = Option<T>> + 'a {
FutureRacePop { futures }
_FutureRacePop { futures }
}

struct FutureRacePop<'a, T, F: Future<Output = T> + Unpin> {
struct _FutureRacePop<'a, T, F: Future<Output = T> + Unpin> {
futures: &'a mut Vec<F>,
}

impl<'a, T, F: Future<Output = T> + Unpin> Future for FutureRacePop<'a, T, F> {
impl<'a, T, F: Future<Output = T> + Unpin> Future for _FutureRacePop<'a, T, F> {
type Output = Option<T>;

fn poll(mut self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> {
Expand Down
1 change: 0 additions & 1 deletion turbopack/crates/turbopack-node/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![feature(async_closure)]
#![feature(min_specialization)]
#![feature(lint_reasons)]
#![feature(arbitrary_self_types)]
#![feature(extract_if)]

Expand Down
1 change: 0 additions & 1 deletion turbopack/crates/turbopack-nodejs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(lint_reasons)]
#![feature(iter_intersperse)]
#![feature(arbitrary_self_types)]

Expand Down

0 comments on commit beb9842

Please sign in to comment.