Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"extern blocks must be unsafe" for 2024 edition #4218

Open
zroug opened this issue Oct 22, 2024 · 0 comments
Open

"extern blocks must be unsafe" for 2024 edition #4218

zroug opened this issue Oct 22, 2024 · 0 comments
Labels

Comments

@zroug
Copy link

zroug commented Oct 22, 2024

Describe the Bug

wasm_bindgen attribute doesn't work for extern blocks in 2024 edition.

Steps to Reproduce

  1. Use rustc 1.84.0-nightly and configure project to use 2024 edition.
  2. Try to compile
    use wasm_bindgen::prelude::*;
    
    #[wasm_bindgen]
    extern {
        pub fn test();
    }
  3. Playground link (but it can't be reproduced on the playground because it only affects the WASM target).

Expected Behavior

The example should compile.

Actual Behavior

error: extern blocks must be unsafe
 --> src/test.rs:5:9
  |
5 |     pub fn test();
  |            ^^^^

Note: Adding the unsafe keyword to the extern block doesn't help, same error.

@zroug zroug added the bug label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant