Skip to content

Fix Rust 2024 export-attribute breakage in rebuild-wasm - #1

Draft
cmoulliard with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-rebuild-wasm-job
Draft

Fix Rust 2024 export-attribute breakage in rebuild-wasm#1
cmoulliard with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-rebuild-wasm-job

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown

rebuild-wasm failed after moving the WASM crate to Rust 2024 because exported FFI symbols still used #[no_mangle], which is now treated as an unsafe attribute. The workflow stopped in wasm-build before regenerating downstream artifacts.

  • Root cause addressed

    • Updated all exported WASM FFI functions in wasm-build/src/lib.rs from #[no_mangle] to #[unsafe(no_mangle)] to match Rust 2024 requirements.
  • Rust 2024 compatibility adjustment

    • Added crate-level #![allow(static_mut_refs)] for the existing single-threaded WASM global-handle pattern (PARSERS, TREES, NODES, RESULT_BUF) so the module continues compiling under the stricter edition lints without redesigning runtime state management.
  • Representative change

    // before
    #[no_mangle]
    pub extern "C" fn parser_new() -> i32 { ... }
    
    // after
    #[unsafe(no_mangle)]
    pub extern "C" fn parser_new() -> i32 { ... }

Copilot AI changed the title [WIP] Fix failing GitHub Actions job 'rebuild-wasm' Fix Rust 2024 export-attribute breakage in rebuild-wasm Jun 9, 2026
Copilot AI requested a review from cmoulliard June 9, 2026 12:07
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