Skip to content

Bump Rust nightly to nightly-2026-04-11#3782

Merged
vedhavyas merged 9 commits intomainfrom
feature/rust-nightly-bump-2026-04
Apr 18, 2026
Merged

Bump Rust nightly to nightly-2026-04-11#3782
vedhavyas merged 9 commits intomainfrom
feature/rust-nightly-bump-2026-04

Conversation

@vedhavyas
Copy link
Copy Markdown
Contributor

Bumps Rust nightly from nightly-2025-10-19 to nightly-2026-04-11 — a ~6-month hygiene update aligning with the Abundance project. All Rust code changes and a one-line fix in the polkadot-sdk fork are required for compilation to succeed on the new nightly.

Commits

Reviewers are encouraged to go commit-by-commit.

  1. de946fda2 — update Rust nightly to nightly-2026-04-11
    Updates rust-toolchain.toml from nightly-2025-10-19 to nightly-2026-04-11.

  2. 633381ae2 — fix compiler ICE in subspace-proof-of-space find_proof
    The find_proof() function in crates/subspace-proof-of-space/src/chiapos/tables.rs triggered a compiler ICE due to the generic_const_exprs + RPIT + closure-capturing-self combination. Refactored to extract the per-proof logic into a separate non-generic helper method, following Abundance's pattern.

  3. 40659bfdf — remove stabilized feature gates for nightly-2026-04-11
    Removes #![feature(...)] declarations for features stabilized in the 6-month nightly gap: array_windows, maybe_uninit_slice, maybe_uninit_write_slice, vec_into_raw_parts, assert_matches, if_let_guard, const_try, trusted_len, int_roundings, iter_collect_into, impl_trait_in_assoc_type, type_alias_impl_trait, box_into_inner. Updates assert_matches imports to the stabilized path.

  4. d4303e640 — fix new clippy lints and try block inference for nightly-2026-04-11

    • clippy::manual_saturating_arithmetic in archiver
    • clippy::collapsible_match, unnecessary_sort_by, useless_conversion, unnecessary_cast, explicit_counter_loop
    • unfulfilled_lint_expectations: removed stale #[expect(clippy::double_parens)]
    • clippy::result_large_err: #[expect] for substrate-originating error types
    • Try block inference change: explicit .map_err(ProvingError::RecordReadingError) for ReadingError conversions in proving.rs
  5. 43756be00 — fix additional stabilized features and clippy lints for nightly-2026-04-11
    Additional stabilized features missed in the first pass: trait_alias, type_changing_struct_update, and conditional gating of more_qualified_paths to #[cfg_attr(test, ...)]. Re-added iter_collect_into (not actually stabilized) and never_type to subspace-farmer-components (still required). Additional result_large_err fixes in subspace-test-service and subspace-farmerless-dev-node. Rewrote alice_nonce loop in fraud-proof tests to avoid explicit_counter_loop.

  6. e729fafb8 — update polkadot-sdk fork rev for WASM linker fix
    Rust PR #149868 (merged April 4, 2026) stopped passing --allow-undefined to wasm-ld on WASM targets. This broke WASM runtime linking for all bare extern "C" host function declarations generated by the #[runtime_interface] proc macro.

    Fork fix (commit) adds #[cfg_attr(target_family = "wasm", link(wasm_import_module = "env"))] to the generated extern "C" block in sp-runtime-interface-proc-macro. This explicitly marks the imports as WASM imports from the "env" module, matching what the Substrate executor already expects.

    Verified to produce byte-identical runtime_version and runtime_apis custom sections compared to the previous behavior, preserving runtime upgrade and client compatibility. Verification steps performed:

    • WASM imports: 45 vs 45, byte-identical, all in "env" module
    • WASM exports: 97 vs 97, byte-identical
    • runtime_version and runtime_apis custom sections: byte-identical
    • Substrate executor source confirms it requires "env" module and rejects anything else
    • Runtime integrity tests and full test suite pass
  7. c3851a0db — cargo fmt fixes for nightly-2026-04-11
    Formatting adjustments from rustfmt on the new nightly.

Code contributor checklist

Extract the proof-building closure body into a separate
find_proof_internal() static method, avoiding the RPIT + const-generic
+ closure-capturing-self combination that triggers an ICE on
nightly-2026-04-11.
Features stabilized and removed: array_windows, assert_matches,
if_let_guard, const_try, maybe_uninit_slice, maybe_uninit_write_slice,
vec_into_raw_parts, trusted_len, int_roundings, iter_collect_into,
impl_trait_in_assoc_type, type_alias_impl_trait, box_into_inner,
more_qualified_paths, try_blocks (where unused), portable_simd (where
unused).

Features now conditionally gated via cfg_attr: variant_count (test/fuzz
only), portable_simd (alloc/test only in subspace-proof-of-space),
exact_size_is_empty (parallel only), sync_unsafe_cell (parallel only),
get_mut_unchecked and maybe_uninit_fill (alloc only).

Also update assert_matches import path from
std::assert_matches::assert_matches to std::assert_matches (the module
was removed; the macro is now re-exported directly).
- manual_saturating_arithmetic: use saturating_sub() instead of
  checked_sub().unwrap_or_default()
- unfulfilled_lint_expectations: remove #[expect(clippy::double_parens)]
  no longer needed by construct_uint! macro
- collapsible_match: collapse if-in-match to match guards
- unnecessary_sort_by: use sort_unstable_by_key
- useless_conversion: remove redundant .into_iter() calls
- unnecessary_cast: remove u32-to-u32 casts
- explicit_counter_loop: use zip with range instead of manual counters
- result_large_err: allow on RPC builder closures returning sc_service::Error
- try block type inference: add explicit .map_err() for ReadingError->ProvingError
  conversion (new nightly no longer infers From in try blocks)
Bumps subspace-v14 to include the wasm_import_module = "env" fix that
explicitly marks runtime-interface host function imports for wasm-ld.
Needed because Rust PR #149868 stopped passing --allow-undefined to
wasm-ld, which previously masked these undefined symbols.

Verified byte-identical runtime_version and runtime_apis custom sections
compared to the previous build, preserving runtime upgrade and client
compatibility.
@vedhavyas vedhavyas requested a review from nazar-pc as a code owner April 17, 2026 16:05
@immunefi-magnus
Copy link
Copy Markdown

🛡️ Immunefi PR Reviews

We noticed that your project isn't set up for automatic code reviews. If you'd like this PR reviewed by the Immunefi team, you can request it manually using the link below:

🔗 Send this PR in for review

Once submitted, we'll take care of assigning a reviewer and follow up here.

nazar-pc
nazar-pc previously approved these changes Apr 17, 2026
nazar-pc
nazar-pc previously approved these changes Apr 17, 2026
- Gate #![feature(portable_simd)] in subspace-verification behind the
  kzg feature to match the cfg-gate on the Simd usage site. The new
  nightly's unused_features lint flagged the declared-but-not-used case
  when the crate is checked standalone (without kzg).

- Fix unnecessary_sort_by clippy lint in rocm.rs (parallel to the
  earlier cuda.rs fix). CI exercises ROCm features only on Linux/Windows,
  so this path wasn't reached by local macOS clippy.
@vedhavyas vedhavyas enabled auto-merge April 17, 2026 18:38
@vedhavyas vedhavyas added this pull request to the merge queue Apr 17, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 17, 2026
@vedhavyas vedhavyas merged commit a32c37f into main Apr 18, 2026
14 checks passed
@vedhavyas vedhavyas deleted the feature/rust-nightly-bump-2026-04 branch April 18, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants