Skip to content

Rust Analyzer passive or doesn't locate available methods and macros #19116

Open
@wmstack

Description

@wmstack

rust-analyzer version: rust-analyzer version: 0.3.2291-standalone (f3998f7f8a 2025-02-02)

rustc version: rustc 1.84.1 (e71f9a9a9 2025-01-27)

editor or extension: Vscode Rust Analyzer rust-lang.rust-analyzer

relevant settings: Regular Programming in a Simple Crate with cargo init

code snippet to reproduce:

use core::str;


fn main() {
  str::fr
}

Expected output

Image

Actual Output

Image

Issue

Rust Analyzer refuses to look into core::str for methods even though this would be acceptable by the Rust compiler to use directly.

Related Issue

use core::str;
use std::{
  io::stdout,
  process::Command,
};

fn main() {
  let output = Command::new("ls")
    .arg("-a")
    .arg("--color")
    .output()
    .unwrap();
    
    println!("{}", str::from_utf8(output.stdout.refm^));
}
Image Image

Macros ref and refm are not visible when writing .ref. It is kind of impossible to access .ref

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-nameresname, path and module resolutionC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions