rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.36k stars 1.62k forks source link

No field on struct in proc macro, compiles fine. #16941

Open OrdinaryOreo opened 8 months ago

OrdinaryOreo commented 8 months ago

rust-analyzer version: 0.3.1885-standalone

rustc version: rustc 1.77.0

relevant settings: To get the code to run without panicking a discord api token is needed, this isn’t necessary for compiling nor is it necessary to showcase this issue however.

repository link (if public, optional): https://github.com/OrdinaryOreo/r-a_mre

code snippet to reproduce: see main.rs

When using poise trying to use the proc macro as intended with prefix_command always causes rust-analyzer to show the error E0559 as seen in this image: image

Despite this, the code compiles and runs exactly as it should without issue. The code I set up for the mre is essentially just the same code as it's shown in the documentation for poise with minor tweaks to avoid possible confusion. I am very much a beginner in Rust so I do apologize if this bug report isn't super helpful when it could've been more helpful.

OrdinaryOreo commented 8 months ago

This was on vscode, and I tried using helix and the problem does not occur there.

dfireBird commented 8 months ago

If possible can you check whether you are using the same version of rust-analyzer in both helix and vscode?