Skip to content

Commit

Permalink
chore: upgrade Rust to 1.83.0 nightly (#8712)
Browse files Browse the repository at this point in the history
* chore(deps): Switch anymap to anymap3

anymap seems unmaintained and emits a future incompatibility warning
with newer Rust.

chris-morgan/anymap#53

Signed-off-by: Anders Kaseorg <[email protected]>

* chore(deps): Upgrade ctor 0.2.3 to 0.2.9

Fixes “warning: unexpected `cfg` condition value: `used_linker`” with
newer Rust.

mmastrac/rust-ctor#309

Signed-off-by: Anders Kaseorg <[email protected]>

* chore(deps): Replace unmaintained derivative with derive_more

derivative triggers unfixable Clippy lints with new Rust.

rust-lang/rust-clippy#13811

Signed-off-by: Anders Kaseorg <[email protected]>

* chore: Fix clippy::empty_line_after_doc_comments

Signed-off-by: Anders Kaseorg <[email protected]>

* chore: Fix clippy::extra_unused_lifetimes

Signed-off-by: Anders Kaseorg <[email protected]>

* chore: Fix clippy::manual_c_str_literals

Signed-off-by: Anders Kaseorg <[email protected]>

* chore: Fix clippy::needless_lifetimes

Signed-off-by: Anders Kaseorg <[email protected]>

* chore: Fix clippy::needless_return

Signed-off-by: Anders Kaseorg <[email protected]>

* chore: Fix clippy::unnecessary_map_or

Signed-off-by: Anders Kaseorg <[email protected]>

* chore: upgrade Rust to 1.83.0 nightly

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]>

---------

Signed-off-by: Anders Kaseorg <[email protected]>
  • Loading branch information
andersk authored Dec 16, 2024
1 parent e0b1a0f commit 811646f
Show file tree
Hide file tree
Showing 80 changed files with 279 additions and 320 deletions.
67 changes: 44 additions & 23 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ignored = [
]
[workspace.dependencies]
anyhow = { version = "1.0.94", features = ["backtrace"] }
anymap = { version = "=1.0.0-beta.2" }
anymap = { package = "anymap3", version = "1.0.1" }
async-recursion = { version = "1.1.1" }
async-scoped = { version = "0.9.0" }
async-trait = { version = "0.1.83" }
Expand All @@ -39,7 +39,7 @@ concat-string = { version = "1.0.1" }
cow-utils = { version = "0.1.3" }
css-module-lexer = { version = "0.0.15" }
dashmap = { version = "6.1.0" }
derivative = { version = "2.2.0" }
derive_more = { version = "1.0.0" }
either = { version = "1.13.0" }
futures = { version = "0.3.31" }
glob = { version = "0.3.1" }
Expand Down
2 changes: 1 addition & 1 deletion crates/rspack_binding_options/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ignored = ["tracing"]
[dependencies]
async-trait = { workspace = true }
cow-utils = { workspace = true }
derivative = { workspace = true }
derive_more = { workspace = true, features = ["debug"] }
glob = { workspace = true }
napi = { workspace = true, features = ["async", "tokio_rt", "serde-json", "anyhow"] }
napi-derive = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use derivative::Derivative;
use derive_more::Debug;
use napi::Either;
use napi_derive::napi;
use rspack_binding_values::{into_asset_conditions, JsChunkWrapper, RawAssetConditions};
Expand All @@ -15,7 +15,7 @@ pub struct JsBannerContentFnCtx {
pub filename: String,
}

impl<'a> From<BannerContentFnCtx<'a>> for JsBannerContentFnCtx {
impl From<BannerContentFnCtx<'_>> for JsBannerContentFnCtx {
fn from(value: BannerContentFnCtx) -> Self {
Self {
hash: value.hash.to_string(),
Expand Down Expand Up @@ -44,11 +44,10 @@ impl TryFrom<RawBannerContentWrapper> for BannerContent {
}
}

#[derive(Derivative)]
#[derivative(Debug)]
#[derive(Debug)]
#[napi(object, object_to_js = false)]
pub struct RawBannerPluginOptions {
#[derivative(Debug = "ignore")]
#[debug(skip)]
#[napi(ts_type = "string | ((...args: any[]) => any)")]
pub banner: RawBannerContent,
pub entry_only: Option<bool>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cow_utils::CowUtils;
use derivative::Derivative;
use derive_more::Debug;
use napi::{bindgen_prelude::Buffer, Either};
use napi_derive::napi;
use rspack_core::rspack_sources::RawSource;
Expand All @@ -22,12 +22,11 @@ pub struct RawToOptions {
pub absolute_filename: String,
}

#[derive(Derivative)]
#[derivative(Debug, Clone)]
#[derive(Debug, Clone)]
#[napi(object, object_to_js = false)]
pub struct RawCopyPattern {
pub from: String,
#[derivative(Debug = "ignore")]
#[debug(skip)]
#[napi(
ts_type = "string | ((pathData: { context: string; absoluteFilename?: string }) => string | Promise<string>)"
)]
Expand All @@ -39,7 +38,7 @@ pub struct RawCopyPattern {
pub priority: i32,
pub glob_options: RawCopyGlobOptions,
pub info: Option<RawInfo>,
#[derivative(Debug = "ignore")]
#[debug(skip)]
#[napi(
ts_type = "(input: Buffer, absoluteFilename: string) => string | Buffer | Promise<string> | Promise<Buffer>"
)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use std::sync::Arc;

use derivative::Derivative;
use derive_more::Debug;
use napi::Either;
use napi_derive::napi;
use rspack_napi::threadsafe_function::ThreadsafeFunction;
use rspack_plugin_progress::{ProgressPluginDisplayOptions, ProgressPluginOptions};

type HandlerFn = ThreadsafeFunction<(f64, String, Vec<String>), ()>;
#[derive(Derivative)]
#[derivative(Debug)]
#[derive(Debug)]
#[napi(object, object_to_js = false)]
pub struct RawProgressPluginOptions {
// the prefix name of progress bar
Expand All @@ -22,7 +21,7 @@ pub struct RawProgressPluginOptions {
// the progress characters
pub progress_chars: Option<String>,
// the handler for progress event
#[derivative(Debug = "ignore")]
#[debug(skip)]
#[napi(ts_type = "(percent: number, msg: string, items: string[]) => void")]
pub handler: Option<HandlerFn>,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use derivative::Derivative;
use derive_more::Debug;
use napi_derive::napi;
use rspack_napi::threadsafe_function::ThreadsafeFunction;
use rspack_plugin_size_limits::{AssetFilterFn, SizeLimitsPluginOptions};

#[derive(Derivative)]
#[derivative(Debug)]
#[derive(Debug)]
#[napi(object, object_to_js = false)]
pub struct RawSizeLimitsPluginOptions {
#[derivative(Debug = "ignore")]
#[debug(skip)]
#[napi(ts_type = "(assetFilename: string) => boolean")]
pub asset_filter: Option<ThreadsafeFunction<String, bool>>,
#[napi(ts_type = "\"error\" | \"warning\"")]
Expand Down
14 changes: 6 additions & 8 deletions crates/rspack_binding_options/src/options/raw_module/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::fmt::Formatter;
use std::{collections::HashMap, fmt::Debug, sync::Arc};
use std::{collections::HashMap, sync::Arc};

use derivative::Derivative;
use derive_more::Debug;
use napi::bindgen_prelude::Either3;
use napi::Either;
use napi_derive::napi;
Expand Down Expand Up @@ -491,15 +491,14 @@ impl From<RawGeneratorOptions> for GeneratorOptions {
}
}

#[derive(Derivative, Default)]
#[derivative(Debug)]
#[derive(Default, Debug)]
#[napi(object, object_to_js = false)]
pub struct RawAssetGeneratorOptions {
pub emit: Option<bool>,
pub filename: Option<JsFilename>,
#[napi(ts_type = "\"auto\" | JsFilename")]
pub public_path: Option<JsFilename>,
#[derivative(Debug = "ignore")]
#[debug(skip)]
#[napi(
ts_type = "RawAssetGeneratorDataUrlOptions | ((arg: RawAssetGeneratorDataUrlFnArgs) => string)"
)]
Expand All @@ -519,11 +518,10 @@ impl From<RawAssetGeneratorOptions> for AssetGeneratorOptions {
}
}

#[derive(Derivative, Default)]
#[derivative(Debug)]
#[derive(Default, Debug)]
#[napi(object, object_to_js = false)]
pub struct RawAssetInlineGeneratorOptions {
#[derivative(Debug = "ignore")]
#[debug(skip)]
#[napi(
ts_type = "RawAssetGeneratorDataUrlOptions | ((arg: RawAssetGeneratorDataUrlFnArgs) => string)"
)]
Expand Down
Loading

2 comments on commit 811646f

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Ran ecosystem CI: Open

suite result
modernjs ❌ failure
_selftest ✅ success
rsdoctor ❌ failure
rspress ✅ success
rslib ✅ success
rsbuild ❌ failure
examples ❌ failure
devserver ✅ success
nuxt ✅ success

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Benchmark detail: Open

Name Base (2024-12-16 2f4992b) Current Change
10000_big_production-mode_disable-minimize + exec 38.4 s ± 586 ms 38.1 s ± 495 ms -0.79 %
10000_development-mode + exec 1.89 s ± 64 ms 1.85 s ± 35 ms -1.77 %
10000_development-mode_hmr + exec 690 ms ± 23 ms 680 ms ± 5.7 ms -1.41 %
10000_production-mode + exec 2.49 s ± 47 ms 2.48 s ± 94 ms -0.35 %
arco-pro_development-mode + exec 1.77 s ± 76 ms 1.77 s ± 55 ms -0.38 %
arco-pro_development-mode_hmr + exec 379 ms ± 1.4 ms 378 ms ± 0.84 ms -0.20 %
arco-pro_production-mode + exec 3.33 s ± 128 ms 3.31 s ± 94 ms -0.52 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.41 s ± 149 ms 3.38 s ± 99 ms -0.79 %
arco-pro_production-mode_traverse-chunk-modules + exec 3.34 s ± 90 ms 3.32 s ± 97 ms -0.54 %
threejs_development-mode_10x + exec 1.62 s ± 14 ms 1.63 s ± 31 ms +0.98 %
threejs_development-mode_10x_hmr + exec 787 ms ± 10 ms 805 ms ± 23 ms +2.28 %
threejs_production-mode_10x + exec 5.42 s ± 77 ms 5.46 s ± 211 ms +0.82 %
10000_big_production-mode_disable-minimize + rss memory 9499 MiB ± 255 MiB 9481 MiB ± 272 MiB -0.20 %
10000_development-mode + rss memory 629 MiB ± 18.3 MiB 669 MiB ± 14.1 MiB +6.41 %
10000_development-mode_hmr + rss memory 1515 MiB ± 164 MiB 1525 MiB ± 304 MiB +0.68 %
10000_production-mode + rss memory 590 MiB ± 18 MiB 671 MiB ± 33.8 MiB +13.68 %
arco-pro_development-mode + rss memory 570 MiB ± 26.4 MiB 569 MiB ± 34.1 MiB -0.14 %
arco-pro_development-mode_hmr + rss memory 640 MiB ± 39 MiB 602 MiB ± 31.1 MiB -5.94 %
arco-pro_production-mode + rss memory 690 MiB ± 48.5 MiB 737 MiB ± 42.4 MiB +6.72 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 736 MiB ± 73.2 MiB 730 MiB ± 60 MiB -0.71 %
arco-pro_production-mode_traverse-chunk-modules + rss memory 728 MiB ± 34.9 MiB 720 MiB ± 26.2 MiB -1.09 %
threejs_development-mode_10x + rss memory 590 MiB ± 19.2 MiB 598 MiB ± 12.3 MiB +1.37 %
threejs_development-mode_10x_hmr + rss memory 1125 MiB ± 168 MiB 1199 MiB ± 166 MiB +6.53 %
threejs_production-mode_10x + rss memory 896 MiB ± 52.9 MiB 906 MiB ± 32.2 MiB +1.07 %

Please sign in to comment.