Skip to content

request handler panicked: Can't find [email protected] in AstIdMap #15634

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

Closed
steffahn opened this issue Sep 19, 2023 · 1 comment · Fixed by #18555
Closed

request handler panicked: Can't find [email protected] in AstIdMap #15634

steffahn opened this issue Sep 19, 2023 · 1 comment · Fixed by #18555
Labels

Comments

@steffahn
Copy link
Member

In this code

struct Foo;

macro_rules! Fooo {
    () => { Foo }
}

trait Trait<T> {
    type Ty: Trait<T>;
}

impl Trait<Fooo!()> for () {
    // <<--- “Implement missing members”
}

fn main() {
    println!("Hello, world!");
}

I’m executing Implement missing members quick fix at the location indicated.

Error message:

request handler panicked: Can't find [email protected] in AstIdMap:
[SyntaxNodePtr { kind: STRUCT, range: 0..11 }, SyntaxNodePtr { kind: MACRO_RULES, range: 13..52 }, SyntaxNodePtr { kind: TRAIT, range: 54..95 }, SyntaxNodePtr { kind: IMPL, range: 97..132 }, SyntaxNodePtr { kind: FN, range: 134..178 }, SyntaxNodePtr { kind: TYPE_ALIAS, range: 75..93 }, SyntaxNodePtr { kind: MACRO_CALL, range: 108..115 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 144..178 }, SyntaxNodePtr { kind: MACRO_CALL, range: 150..175 }]

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

rust-analyzer version: 0.3.1665-standalone

rustc version: (eg. output of rustc -V)

rustc 1.74.0-nightly (65ea825f4 2023-09-18)

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)
(I don’t think these are relevant)

@steffahn steffahn added the C-bug Category: bug label Sep 19, 2023
@Veykril
Copy link
Member

Veykril commented Sep 20, 2023

probably similar issue to #10388 (we really need a type hir mapping, otherwise this will keep happening wth type macros i reckon)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants