Skip to content

rusy-analyzer can't show definition for extern crate #14350

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
Iolop opened this issue Mar 14, 2023 · 1 comment
Open

rusy-analyzer can't show definition for extern crate #14350

Iolop opened this issue Mar 14, 2023 · 1 comment
Labels
C-bug Category: bug

Comments

@Iolop
Copy link

Iolop commented Mar 14, 2023

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P) rust-analyzer version: 0.3.1435-standalone

rustc version: (eg. output of rustc -V)rustc 1.67.1 (d5a82bbd2 2023-02-07)

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)
rust-src installed

rusy-analyzer performs well when no extern crate imported like below,it could remind me that unused import and jump to Add definition
image

however, when i use cargo new PRJ and add dependencies as follow

[dependencies]
libafl = {path="/home/aria/Desktop/LibAFL/libafl"}

rust-analyzer failed to find the source and definitions of all structures even defined in this scope like Cacher
image

cargo check cargo build works fine in this PRJ

cargo check
    Updating `ustc` index
    Checking baby_fuzzer v0.1.0 (/home/aria/Desktop/fuzzer/baby_fuzzer)
warning: unused import: `std::ops::Add`
 --> src/main.rs:2:5
  |
2 | use std::ops::Add;
  |     ^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused imports: `BytesInput`, `HasTargetBytes`, `bolts::AsSlice`, `executors::ExitKind`
 --> src/main.rs:4:5
  |
4 |     bolts::AsSlice,
  |     ^^^^^^^^^^^^^^
5 |     inputs::{BytesInput, HasTargetBytes},
  |              ^^^^^^^^^^  ^^^^^^^^^^^^^^
6 |     executors::ExitKind,
  |     ^^^^^^^^^^^^^^^^^^^

warning: `baby_fuzzer` (bin "baby_fuzzer") generated 2 warnings
    Finished dev [unoptimized + debuginfo] target(s) in 0.91s

I'm newbie to rust, so all setting is default.
I try to find any logs in OUTPUT window from RA Client or RA language server but nothing there.

@Iolop Iolop added the C-bug Category: bug label Mar 14, 2023
@lnicola
Copy link
Member

lnicola commented Mar 14, 2023

CC #3898

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

2 participants