Skip to content

Unable to find definition for hashbrown #17606

@fishincat

Description

@fishincat

I have describe this at stackoverflow: https://stackoverflow.com/questions/78754358/vscode-rust-analyzer-can-not-find-definition-of-hashbrown

here is my code:

main.rs

use std::collections::HashMap;

fn main() {
    let _ = HashMap::<i32, i32>::new();
    println!("Hello, world!")
}

Cargo.toml

[package]
name = "world_hello"
version = "0.1.0"
edition = "2021"

[dependencies]

rust-analyzer version is: v0.3.2037 (actually no version works)

rust version

Default host: x86_64-apple-darwin
rustup home:  /Users/fishincat/.rustup

installed toolchains
--------------------

stable-x86_64-apple-darwin (default)
nightly-2023-12-28-x86_64-apple-darwin
nightly-2024-01-26-x86_64-apple-darwin
nightly-x86_64-apple-darwin

active toolchain
----------------

stable-x86_64-apple-darwin (default)
rustc 1.77.2 (25ef9e3d8 2024-04-09)

rustup component list --installed

cargo-x86_64-apple-darwin
clippy-x86_64-apple-darwin
rust-docs-x86_64-apple-darwin
rust-src
rust-std-x86_64-apple-darwin
rustc-x86_64-apple-darwin
rustfmt-x86_64-apple-darwin

my problem is:

When I jump to the definition of HashMap:

...
use hashbrown::hash_map as base;
...

pub struct HashMap<K, V, S = RandomState> {
    base: base::HashMap<K, V, S>,
}

I can not go deep to the definition of base(hashbrown), it shows:

No Definition found for hashbrown

how to solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions