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

macro-error: the self argument is only allowed for functions in impl blocks. #19121

Closed
ahaoboy opened this issue Feb 9, 2025 · 0 comments · Fixed by #19125
Closed

macro-error: the self argument is only allowed for functions in impl blocks. #19121

ahaoboy opened this issue Feb 9, 2025 · 0 comments · Fixed by #19125
Assignees
Labels
C-bug Category: bug

Comments

@ahaoboy
Copy link
Contributor

ahaoboy commented Feb 9, 2025

This error is displayed in both ubuntu2404 and win11, but the code can be compiled and run correctly. I don't know if it is a problem with wasm_bindgen or ra.

the `self` argument is only allowed for functions in `impl` blocks.

If the function is already in an `impl` block, did you perhaps forget to add `#[wasm_bindgen]` to the `impl` block?rust-analyzer[macro-error](https://rust-analyzer.github.io/manual.html#macro-error)

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)

rust-analyzer version: 0.3.2291-standalone (f3998f7 2025-02-02) [c:\Users\ace.vscode\extensions\rust-lang.rust-analyzer-0.3.2291-win32-x64\server\rust-analyzer.exe]

rustc version: (eg. output of rustc -V)
rustc 1.84.0 (9fc6b4312 2025-01-07)

editor or extension: (eg. VSCode, Vim, Emacs, etc. For VSCode users, specify your extension version; for users of other editors, provide the distribution if applicable)
vscode

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)

default

repository link (if public, optional): (eg. rust-analyzer)

https://github.com/ahaoboy/ra-issue

code snippet to reproduce:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants