Skip to content

"Function 'resolve_variant' is private" error when running on rust-analyzer itself #19889

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

Open
MatrixFrog opened this issue May 29, 2025 · 1 comment
Labels
C-bug Category: bug

Comments

@MatrixFrog
Copy link
Contributor

MatrixFrog commented May 29, 2025

I'm using rust-analyzer while trying to make changes to rust-analyzer, and getting an error reported here:

let def_id = sema.resolve_variant(record_lit)?;

function resolve_variant is private (E0624)

But Semantics::resolve_variant is public. rust-analyzer seems to think this line is actually calling SemanticsImpl::resolve_variant, which indeed is private. But it's accessible (or rather, would be if it were public) becase Semantics implements Deref<Target=SemanticsImpl> so that's confusing rust-analyzer I guess.

Tried making a minimal repro but I'm not getting the error here so maybe it only happens when you're accessing methods across a crate boundary or something. https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=a90984eb9d3bbabc1e0c570422e77388

Version 0.4.2477, Server Version 0.4.2477-standalone

@MatrixFrog MatrixFrog added the C-bug Category: bug label May 29, 2025
@MatrixFrog
Copy link
Contributor Author

I'll try to get a minimal repro that works but I realize this is probably an unusual enough case that it's not particularly critical to solve.

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

No branches or pull requests

1 participant