VSCode rust plugin error : [init] function already declared

Hello,
I wonder if anyone else have the same issue.
I am following the rust counter example
and I am getting an error in vscode from rust analyzer
image

However running cargo check doesn’t show any issues.
The issue also happens with the main rust plugin

"dfx": "0.8.4"
rust-analyzer: v0.2.890 updating to v0.3.896 also doesn’t solve the issue.

The issue is not a blocker but it’s just annoying.

3 Likes

This is happening to me in multiple projects and I would also love for it to go away

2 Likes

Yeah, it’s on our radar. I think we’ll be able to prioritize this in the next couple of sprints

2 Likes

Looks like there was an answer in another thread:

changing #init to #[export_name = "canister_init"] seems to satisfy the IDE

4 Likes

I this PR is aiming to address the problem.

2 Likes