-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
RA fails to infere types #18276
Comments
Slightly simplified to:
The |
After some more digging, it turned out to be a different problem. This expands to the following:
rust-analyzer doesn't seem to pick up the impl in this function, while rustc does (though it warns about a non-local impl). Full repro
Minimal example of the problem:
|
We don't (want to) support function-local trait impls. |
rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
0.4.2141-standalone (0fb804a 2024-10-09) [/home/vscode/.vscode-server/extensions/rust-lang.rust-analyzer-0.4.2141-linux-arm64/server/rust-analyzer]
rustc version: (eg. output of
rustc -V
)rustc 1.82.0-nightly (fbccf5053 2024-07-27)
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
orCARGO_HOME
)repository link (if public, optional): (eg. rust-analyzer)
https://github.com/xenoliss/ra-issue-type-inference
code snippet to reproduce:
See https://github.com/xenoliss/ra-issue-type-inference/blob/main/src/main.rs
The text was updated successfully, but these errors were encountered: