Skip to content

Commit

Permalink
chore: upgrade Rust to 1.83.0 nightly
Browse files Browse the repository at this point in the history
Upgrade Rust to nightly-2024-11-27, which was built on the same day as
1.83.0 stable.

Signed-off-by: Anders Kaseorg <[email protected]>
  • Loading branch information
andersk committed Dec 15, 2024
1 parent 657e50a commit 33f9409
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion 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 crates/rspack_collections/src/ukey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ where
pub fn get_many_mut<const N: usize>(
&mut self,
ids: [&<Item as DatabaseItem>::ItemUkey; N],
) -> Option<[&mut Item; N]> {
) -> [Option<&mut Item>; N] {
self.inner.get_many_mut(ids)
}

Expand Down
5 changes: 2 additions & 3 deletions crates/rspack_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#![feature(box_patterns)]
#![feature(anonymous_lifetime_in_impl_trait)]
#![feature(hash_raw_entry)]
#![feature(option_get_or_insert_default)]

use std::{fmt, sync::Arc};
mod cgm_hash_results;
Expand Down Expand Up @@ -315,7 +314,7 @@ impl ChunkByUkey {
pub fn get_many_mut<const N: usize>(
&mut self,
ukeys: [&ChunkUkey; N],
) -> Option<[&mut Chunk; N]> {
) -> [Option<&mut Chunk>; N] {
self.inner.get_many_mut(ukeys)
}

Expand Down Expand Up @@ -393,7 +392,7 @@ impl ChunkGroupByUkey {
pub fn get_many_mut<const N: usize>(
&mut self,
ukeys: [&ChunkGroupUkey; N],
) -> Option<[&mut ChunkGroup; N]> {
) -> [Option<&mut ChunkGroup>; N] {
self.inner.get_many_mut(ukeys)
}

Expand Down
1 change: 0 additions & 1 deletion crates/rspack_plugin_css/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![feature(let_chains)]
#![feature(if_let_guard)]
#![feature(box_patterns)]
#![feature(option_get_or_insert_default)]

pub mod dependency;
pub mod parser_and_generator;
Expand Down
1 change: 0 additions & 1 deletion crates/rspack_plugin_javascript/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(option_get_or_insert_default)]
#![feature(if_let_guard)]
#![feature(let_chains)]
#![feature(box_patterns)]
Expand Down
1 change: 0 additions & 1 deletion crates/rspack_plugin_merge_duplicate_chunks/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(option_get_or_insert_default)]
#![feature(let_chains)]

use rspack_collections::UkeySet;
Expand Down
6 changes: 4 additions & 2 deletions crates/rspack_plugin_remove_duplicate_modules/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ fn optimize_chunks(&self, compilation: &mut Compilation) -> Result<Option<bool>>
compilation.chunk_graph.add_chunk(new_chunk_ukey);

for chunk_ukey in &chunks {
let [new_chunk, origin] = compilation
let [Some(new_chunk), Some(origin)] = compilation
.chunk_by_ukey
.get_many_mut([&new_chunk_ukey, chunk_ukey])
.expect("should have both chunks");
else {
panic!("should have both chunks")
};
origin.split(new_chunk, &mut compilation.chunk_group_by_ukey);
if let Some(mutations) = compilation.incremental.mutations_write() {
mutations.add(Mutation::ChunkSplit {
Expand Down
6 changes: 4 additions & 2 deletions crates/rspack_plugin_split_chunks/src/plugin/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,12 @@ impl SplitChunksPlugin {
let new_chunk_ukey = new_chunk;
for original_chunk_ukey in original_chunks {
debug_assert!(&new_chunk_ukey != original_chunk_ukey);
let [new_chunk, original_chunk] = compilation
let [Some(new_chunk), Some(original_chunk)] = compilation
.chunk_by_ukey
.get_many_mut([&new_chunk_ukey, original_chunk_ukey])
.expect("split_from_original_chunks failed");
else {
panic!("split_from_original_chunks failed")
};
original_chunk.split(new_chunk, &mut compilation.chunk_group_by_ukey);
if let Some(mutations) = compilation.incremental.mutations_write() {
mutations.add(Mutation::ChunkSplit {
Expand Down
6 changes: 4 additions & 2 deletions crates/rspack_plugin_split_chunks/src/plugin/max_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,12 @@ impl SplitChunksPlugin {
new_chunk_ukey
};

let [new_part, chunk] = compilation
let [Some(new_part), Some(chunk)] = compilation
.chunk_by_ukey
.get_many_mut([&new_chunk_ukey, &old_chunk])
.expect("split_from_original_chunks failed");
else {
panic!("split_from_original_chunks failed")
};
let new_part_ukey = new_part.ukey();
chunk.split(new_part, &mut compilation.chunk_group_by_ukey);
if let Some(mutations) = compilation.incremental.mutations_write() {
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
profile = "default"
# Use nightly for better access to the latest Rust features.
# This date is aligned to stable release dates.
channel = "nightly-2024-09-05" # v1.81.0
channel = "nightly-2024-11-27" # v1.83.0

0 comments on commit 33f9409

Please sign in to comment.