Skip to content

Commit 189f2da

Browse files
authored
Update Rust toolchain to nightly-2024-10-04 (vercel#70803)
This: - Updates the toolchain file - Adds `#![feature(arbitrary_self_types_pointers)]` as necessary - Removes opt-ins for now-stable features like `option_get_or_insert_default` - Removes now-detectable dead code
1 parent 4c3d192 commit 189f2da

File tree

183 files changed

+402
-248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+402
-248
lines changed

Cargo.lock

+16-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ serde_path_to_error = "0.1.9"
191191
serde_qs = "0.11.0"
192192
serde_with = "2.3.2"
193193
serde_yaml = "0.9.17"
194-
shadow-rs = { version = "0.23.0", default-features = false, features = [
194+
shadow-rs = { version = "0.35.0", default-features = false, features = [
195195
"tzdb",
196196
] }
197197
smallvec = { version = "1.13.1", features = [

crates/napi/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ DEALINGS IN THE SOFTWARE.
2929
#![recursion_limit = "2048"]
3030
//#![deny(clippy::all)]
3131
#![feature(arbitrary_self_types)]
32+
#![feature(arbitrary_self_types_pointers)]
3233

3334
#[macro_use]
3435
extern crate napi_derive;

crates/napi/src/next_api/project.rs

+1
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,7 @@ impl From<UpdateInfo> for NapiUpdateInfo {
931931
}
932932

933933
/// Subscribes to lifecycle events of the compilation.
934+
///
934935
/// Emits an [UpdateMessage::Start] event when any computation starts.
935936
/// Emits an [UpdateMessage::End] event when there was no computation for the
936937
/// specified time (`aggregation_ms`). The [UpdateMessage::End] event contains

crates/next-api/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![feature(future_join)]
22
#![feature(arbitrary_self_types)]
3+
#![feature(arbitrary_self_types_pointers)]
34
#![feature(impl_trait_in_assoc_type)]
45

56
mod app;

crates/next-build-test/src/lib.rs

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

56
use std::{str::FromStr, time::Instant};
67

crates/next-build/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![feature(type_alias_impl_trait)]
22
#![feature(arbitrary_self_types)]
3+
#![feature(arbitrary_self_types_pointers)]
34

45
pub mod build_options;
56

crates/next-core/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#![feature(str_split_remainder)]
33
#![feature(impl_trait_in_assoc_type)]
44
#![feature(arbitrary_self_types)]
5+
#![feature(arbitrary_self_types_pointers)]
56
#![feature(iter_intersperse)]
67

78
mod app_page_loader_tree;

crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_module.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use turbopack_core::{
88
};
99
use turbopack_ecmascript::chunk::EcmascriptChunkPlaceable;
1010

11-
/// An [EcmascriptClientReferenceModule] is a marker module, used by the
11+
/// A marker module used by the
1212
/// [super::ecmascript_client_reference_proxy_module::EcmascriptClientReferenceProxyModule] to
1313
/// indicate which client reference should appear in the client reference manifest.
1414
#[turbo_tasks::value]

crates/next-core/src/next_dynamic/dynamic_transition.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ use turbopack_core::{context::ProcessResult, reference_type::ReferenceType, sour
66
use super::NextDynamicEntryModule;
77

88
/// This transition is used to create the marker asset for a next/dynamic
9-
/// import. This will get picked up during module processing and will be used to
9+
/// import.
10+
///
11+
/// This will get picked up during module processing and will be used to
1012
/// create the dynamic entry, and the dynamic manifest entry.
1113
#[turbo_tasks::value]
1214
pub struct NextDynamicTransition {

crates/next-core/src/next_edge/route_regex.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,11 @@ fn get_named_parametrized_route(
245245

246246
/// This function extends `getRouteRegex` generating also a named regexp where
247247
/// each group is named along with a routeKeys object that indexes the assigned
248-
/// named group with its corresponding key. When the routeKeys need to be
249-
/// prefixed to uniquely identify internally the "prefixRouteKey" arg should
250-
/// be "true" currently this is only the case when creating the routes-manifest
251-
/// during the build
248+
/// named group with its corresponding key.
249+
///
250+
/// When the routeKeys need to be prefixed to uniquely identify internally the
251+
/// "prefixRouteKey" arg should be "true" currently this is only the case when
252+
/// creating the routes-manifest during the build
252253
pub fn get_named_route_regex(normalized_route: &str) -> NamedRouteRegex {
253254
let (parameterized_route, route_keys) = get_named_parametrized_route(normalized_route, false);
254255
let regex = get_route_regex(normalized_route);

crates/next-core/src/next_telemetry.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ use turbo_tasks::{RcStr, Vc};
33
use turbopack_core::diagnostics::{Diagnostic, DiagnosticPayload};
44

55
/// A structure that keeps track of whether a particular Next.js feature is
6-
/// enabled for the telemetry. The original implementation code can be found at the following [link](https://github.com/vercel/next.js/blob/9da305fe320b89ee2f8c3cfb7ecbf48856368913/packages/next/src/build/webpack-config.ts#L2516).
6+
/// enabled for the telemetry.
7+
///
8+
/// The original implementation code can be found
9+
/// [here](https://github.com/vercel/next.js/blob/9da305fe320b89ee2f8c3cfb7ecbf48856368913/packages/next/src/build/webpack-config.ts#L2516).
710
#[turbo_tasks::value(shared)]
811
pub struct NextFeatureTelemetry {
912
pub event_name: RcStr,

crates/next-custom-transforms/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ DEALINGS IN THE SOFTWARE.
3030
#![deny(clippy::all)]
3131
#![feature(box_patterns)]
3232
#![feature(arbitrary_self_types)]
33+
#![feature(arbitrary_self_types_pointers)]
3334

3435
pub mod chain_transforms;
3536
pub mod transforms;

crates/next-custom-transforms/src/transforms/fonts/find_functions_outside_module_scope.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub struct FindFunctionsOutsideModuleScope<'a> {
99
pub state: &'a super::State,
1010
}
1111

12-
impl<'a> Visit for FindFunctionsOutsideModuleScope<'a> {
12+
impl Visit for FindFunctionsOutsideModuleScope<'_> {
1313
noop_visit_type!();
1414

1515
fn visit_ident(&mut self, ident: &Ident) {

crates/next-custom-transforms/src/transforms/fonts/font_functions_collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct FontFunctionsCollector<'a> {
1212
pub state: &'a mut super::State,
1313
}
1414

15-
impl<'a> Visit for FontFunctionsCollector<'a> {
15+
impl Visit for FontFunctionsCollector<'_> {
1616
noop_visit_type!();
1717

1818
fn visit_import_decl(&mut self, import_decl: &ImportDecl) {

crates/next-custom-transforms/src/transforms/fonts/font_imports_generator.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct FontImportsGenerator<'a> {
1313
pub relative_path: &'a str,
1414
}
1515

16-
impl<'a> FontImportsGenerator<'a> {
16+
impl FontImportsGenerator<'_> {
1717
fn check_call_expr(
1818
&mut self,
1919
call_expr: &CallExpr,
@@ -145,7 +145,7 @@ impl<'a> FontImportsGenerator<'a> {
145145
}
146146
}
147147

148-
impl<'a> Visit for FontImportsGenerator<'a> {
148+
impl Visit for FontImportsGenerator<'_> {
149149
noop_visit_type!();
150150

151151
fn visit_module_item(&mut self, item: &ModuleItem) {

crates/next-custom-transforms/src/transforms/react_server_components.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,6 @@ impl ReactServerComponentValidator {
840840
/// dynamic(() => import(...), { ssr: true }) // ✅
841841
/// dynamic(() => import(...), { ssr: false }) // ❌
842842
/// ```
843-
844843
fn check_for_next_ssr_false(&self, node: &CallExpr) -> Option<()> {
845844
if !self.is_callee_next_dynamic(&node.callee) {
846845
return None;
@@ -934,8 +933,10 @@ impl Visit for ReactServerComponentValidator {
934933

935934
/// Returns a visitor to assert react server components without any transform.
936935
/// This is for the Turbopack which have its own transform phase for the server
937-
/// components proxy. Also this returns a visitor instead of fold, performs
938-
/// better than running whole transform as a folder.
936+
/// components proxy.
937+
///
938+
/// This also returns a visitor instead of fold and performs better than running
939+
/// whole transform as a folder.
939940
pub fn server_components_assert(
940941
filename: FileName,
941942
config: Config,

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "nightly-2024-08-01"
2+
channel = "nightly-2024-10-04"
33
components = ["rustfmt", "clippy", "rust-analyzer"]
44
profile = "minimal"

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

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![feature(min_specialization)]
22
#![feature(arbitrary_self_types)]
3+
#![feature(arbitrary_self_types_pointers)]
34

45
mod nft_json;
56

turbopack/crates/node-file-trace/src/main.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![feature(min_specialization)]
2+
#![allow(clippy::needless_return)] // clippy bug causes false positive
23

34
use std::sync::Arc;
45

@@ -26,5 +27,6 @@ async fn main() -> Result<()> {
2627
println!("{}", file);
2728
}
2829
}
30+
2931
Ok(())
3032
}

turbopack/crates/turbo-static/src/call_resolver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct CallResolver<'a> {
1212
}
1313

1414
/// On drop, serialize the state to disk
15-
impl<'a> Drop for CallResolver<'a> {
15+
impl Drop for CallResolver<'_> {
1616
fn drop(&mut self) {
1717
let file = OpenOptions::new()
1818
.create(true)

turbopack/crates/turbo-static/src/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(entry_insert)]
2-
31
use std::{
42
collections::{HashMap, HashSet},
53
error::Error,

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ impl<'a, K, V> Iterator for Iter<'a, K, V> {
410410
}
411411
}
412412

413-
impl<'a, K, V> Clone for Iter<'a, K, V> {
413+
impl<K, V> Clone for Iter<'_, K, V> {
414414
fn clone(&self) -> Self {
415415
match self {
416416
Iter::List(iter) => Iter::List(iter.clone()),
@@ -590,7 +590,7 @@ impl<'a, K: Eq + Hash, V, H: BuildHasher, const I: usize> OccupiedEntry<'a, K, V
590590
}
591591
}
592592

593-
impl<'a, K: Eq + Hash, V, H: BuildHasher + Default, const I: usize> OccupiedEntry<'a, K, V, H, I> {
593+
impl<K: Eq + Hash, V, H: BuildHasher + Default, const I: usize> OccupiedEntry<'_, K, V, H, I> {
594594
/// see [HashMap::OccupiedEntry::remove](https://doc.rust-lang.org/std/collections/hash_map/enum.OccupiedEntry.html#method.remove)
595595
pub fn remove(self) -> V {
596596
match self {
@@ -663,9 +663,7 @@ impl<'a, K: Eq + Hash, V, H: BuildHasher, const I: usize> OccupiedRawEntry<'a, K
663663
}
664664
}
665665

666-
impl<'a, K: Eq + Hash, V, H: BuildHasher + Default, const I: usize>
667-
OccupiedRawEntry<'a, K, V, H, I>
668-
{
666+
impl<K: Eq + Hash, V, H: BuildHasher + Default, const I: usize> OccupiedRawEntry<'_, K, V, H, I> {
669667
/// see [HashMap::OccupiedEntry::remove](https://doc.rust-lang.org/std/collections/hash_map/enum.OccupiedEntry.html#method.remove)
670668
pub fn remove(self) -> V {
671669
match self {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl<'a, K> Iterator for Iter<'a, K> {
141141
}
142142
}
143143

144-
impl<'a, K> Clone for Iter<'a, K> {
144+
impl<K> Clone for Iter<'_, K> {
145145
fn clone(&self) -> Self {
146146
Self(self.0.clone())
147147
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pub(crate) struct OperationGuard<'a> {
204204
backend: &'a TurboTasksBackend,
205205
}
206206

207-
impl<'a> Drop for OperationGuard<'a> {
207+
impl Drop for OperationGuard<'_> {
208208
fn drop(&mut self) {
209209
let fetch_sub = self
210210
.backend

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub struct TaskGuard<'a> {
135135
backend: &'a TurboTasksBackend,
136136
}
137137

138-
impl<'a> Debug for TaskGuard<'a> {
138+
impl Debug for TaskGuard<'_> {
139139
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
140140
let mut d = f.debug_struct("TaskGuard");
141141
d.field("task_id", &self.task_id);
@@ -149,7 +149,7 @@ impl<'a> Debug for TaskGuard<'a> {
149149
}
150150
}
151151

152-
impl<'a> TaskGuard<'a> {
152+
impl TaskGuard<'_> {
153153
pub fn id(&self) -> TaskId {
154154
self.task_id
155155
}

turbopack/crates/turbo-tasks-backend/src/backend/storage.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ where
229229
inner: RefMut<'a, K, InnerStorage<T>, BuildHasherDefault<FxHasher>>,
230230
}
231231

232-
impl<'a, K, T> Deref for StorageWriteGuard<'a, K, T>
232+
impl<K, T> Deref for StorageWriteGuard<'_, K, T>
233233
where
234234
T: KeyValuePair,
235235
T::Key: Indexed,
@@ -242,7 +242,7 @@ where
242242
}
243243
}
244244

245-
impl<'a, K, T> DerefMut for StorageWriteGuard<'a, K, T>
245+
impl<K, T> DerefMut for StorageWriteGuard<'_, K, T>
246246
where
247247
T: KeyValuePair,
248248
T::Key: Indexed,

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

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// TODO: Remove when persistent cache stack is fully landed
2+
// https://linear.app/vercel/issue/PACK-3289
3+
#![allow(dead_code)]
4+
15
mod backend;
26
mod data;
37
mod utils;

turbopack/crates/turbo-tasks-backend/src/utils/dash_map_multi.rs

+5-9
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@ where
2424
},
2525
}
2626

27-
unsafe impl<'a, K: Eq + Hash + Sync, V: Sync, S: BuildHasher> Send for RefMut<'a, K, V, S> {}
28-
unsafe impl<'a, K: Eq + Hash + Sync, V: Sync, S: BuildHasher> Sync for RefMut<'a, K, V, S> {}
29-
30-
impl<'a, K: Eq + Hash, V, S: BuildHasher> RefMut<'a, K, V, S> {
31-
pub fn key(&self) -> &K {
32-
self.pair().0
33-
}
27+
unsafe impl<K: Eq + Hash + Sync, V: Sync, S: BuildHasher> Send for RefMut<'_, K, V, S> {}
28+
unsafe impl<K: Eq + Hash + Sync, V: Sync, S: BuildHasher> Sync for RefMut<'_, K, V, S> {}
3429

30+
impl<K: Eq + Hash, V, S: BuildHasher> RefMut<'_, K, V, S> {
3531
pub fn value(&self) -> &V {
3632
self.pair().1
3733
}
@@ -57,15 +53,15 @@ impl<'a, K: Eq + Hash, V, S: BuildHasher> RefMut<'a, K, V, S> {
5753
}
5854
}
5955

60-
impl<'a, K: Eq + Hash, V, S: BuildHasher> Deref for RefMut<'a, K, V, S> {
56+
impl<K: Eq + Hash, V, S: BuildHasher> Deref for RefMut<'_, K, V, S> {
6157
type Target = V;
6258

6359
fn deref(&self) -> &V {
6460
self.value()
6561
}
6662
}
6763

68-
impl<'a, K: Eq + Hash, V, S: BuildHasher> DerefMut for RefMut<'a, K, V, S> {
64+
impl<K: Eq + Hash, V, S: BuildHasher> DerefMut for RefMut<'_, K, V, S> {
6965
fn deref_mut(&mut self) -> &mut V {
7066
self.value_mut()
7167
}

0 commit comments

Comments
 (0)