rust-lang / rust-lang/rust-analyzer

fails to resolve nested `prelude::*` references

Open
#15,243 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

rust-analyzer version: rust-analyzer 1.70.0 (90c54180 2023-05-31)

rustc version: rustc 1.70.0 (90c541806 2023-05-31)

The following code compiles:

let test_dd = self
    .inner
    .clone()
    .lazy()
    .filter(col(propensity_cfg.target.as_str()).eq(lit(1.0)))
    .select([all()]);

However, the rust-analyzer seems to fail to resolve the function calls col and all that each return Expr. Here is a screenshot that reports the issue accordingly:

Screenshot 2023-07-09 at 1 31 27 PM

Finding the reference to these functions requires following a couple of prelude::* paths.
The definitions are located in the dsl module:

polars::prelude::*  -> polars_lazy::prelude::*  -> crate::dsl::*

Here is a link to the polars crate issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the snippet and tracing the nested prelude paths polars::prelude::* -> polars_lazy::prelude::* -> crate::dsl::*; the issue names no rust-analyzer file or test. Done means rust-analyzer resolves col and all as Expr-returning functions without reporting false unresolved-reference diagnostics.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.