Skip to content

Update toolchain and remove nightly-only flags#13007

Open
hardfist wants to merge 3 commits intomainfrom
codex/rust-impactos-need
Open

Update toolchain and remove nightly-only flags#13007
hardfist wants to merge 3 commits intomainfrom
codex/rust-impactos-need

Conversation

@hardfist
Copy link
Contributor

@hardfist hardfist commented Feb 9, 2026

Summary

  • switch the workspace to the stable Rust toolchain and drop nightly-only compiler flags
  • remove regress pattern feature usages and adjust cacheable annotations to keep dyn traits serializable
  • tweak regex splitting helpers to handle matches without regex engine .split

Testing

  • Not run (not requested)

Copilot AI review requested due to automatic review settings February 9, 2026 09:29
@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Feb 9, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the workspace toward a stable Rust toolchain by removing nightly-only flags/features and updating regex utilities and cacheable annotations to avoid relying on Pattern-based regex integration.

Changes:

  • Switch toolchain from pinned nightly to stable and remove nightly-only -Z* rustflags.
  • Drop pattern features from regex/regress and replace str::split/match_indices usages with iterator-based matching.
  • Adjust #[cacheable] field annotations (notably for dyn trait fields) to preserve rkyv serialization behavior.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
rust-toolchain.toml Switches toolchain channel to stable.
.cargo/config.toml Removes nightly -Z rustflags; adds RUSTC_BOOTSTRAP=1.
Cargo.toml Removes regress pattern feature from workspace deps.
crates/rspack_util/Cargo.toml Removes regex pattern feature.
crates/rspack_util/src/identifier.rs Replaces regex match_indices usage with find_iter.
crates/rspack_plugin_javascript/Cargo.toml Removes regress pattern feature.
crates/rspack_plugin_javascript/src/parser_plugin/initialize_evaluating.rs Reimplements regexp split using find_iter.
crates/rspack_core/src/module_graph/rollback/overlay_map.rs Minor refactor to avoid expect on overlay access.
crates/rspack_core/src/dependencies_block.rs Updates cacheable annotation to use AsCacheable for serialization.
crates/rspack_core/src/concatenated_module.rs Adds AsCacheable annotation for code generation dependency trait objects.
crates/rspack_cacheable_test/tests/macro/cacheable_dyn.rs Adds AsCacheable annotations for dyn fields in tests.
crates/rspack_cacheable_test/tests/macro/manual_cacheable_dyn.rs Adds AsCacheable annotation for dyn field in tests.
crates/rspack_cacheable_test/tests/macro/manual_cacheable_dyn_with_generics.rs Adds AsCacheable annotations for dyn fields in tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# workaround for getting workspace root dir, reference: https://github.com/rust-lang/cargo/issues/3946
[env]
CARGO_WORKSPACE_DIR = { value = "", relative = true }
RUSTC_BOOTSTRAP = "1"
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Setting RUSTC_BOOTSTRAP=1 effectively opts the entire workspace into unstable compiler behavior even on the stable toolchain. This undermines the stated goal of “maximum compatibility” (and can hide accidental nightly-only feature usage); prefer removing this and instead eliminating remaining #![feature(...)]/unstable usages or keeping a pinned nightly toolchain explicitly.

Copilot uses AI. Check for mistakes.
Comment on lines 4 to 5
# Use stable for maximum compatibility.
channel = "stable"
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Switching to channel = "stable" removes the previously pinned toolchain version and can make builds/CI non-reproducible as the stable compiler advances. If reproducibility matters here (it previously did with a dated nightly), consider pinning to a specific stable release (e.g. stable-<version>) or documenting why tracking latest stable is acceptable.

Copilot uses AI. Check for mistakes.
Comment on lines 199 to +203
let regex = eval_regexp_to_regexp(&raw.0, &raw.1);
param.string().split(&regex).map(|s| s.to_owned()).collect()
let input = param.string();
let mut result = Vec::new();
let mut last = 0;
for matched in regex.find_iter(input) {
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

The regexp split behavior was reimplemented manually. Since this file already has unit tests, add coverage for .split(/.../) cases (e.g. matches at start/end, consecutive matches, and patterns that can match empty) to ensure behavior stays consistent with the previous str::split-via-Pattern implementation.

Copilot uses AI. Check for mistakes.
@hardfist hardfist requested a review from stormslowly as a code owner February 9, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant