Skip to content
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

codeLens panic when working on a include!(source) #18704

Closed
edwin0cheng opened this issue Dec 17, 2024 · 0 comments · Fixed by #18727
Closed

codeLens panic when working on a include!(source) #18704

edwin0cheng opened this issue Dec 17, 2024 · 0 comments · Fixed by #18727
Assignees
Labels
C-bug Category: bug

Comments

@edwin0cheng
Copy link
Member

edwin0cheng commented Dec 17, 2024

Here is a MRE for this bug:

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

include!("./out.rs");
// out.rs
#[test]
fn test_out(){
}

When you go to the out.rs file, A panic is triggered:

thread 'Worker' panicked at crates/ide/src/runnables.rs:134:13:
tried adding a runnable pointing to a different file: TestMod { path: "" } for FileId(2014)
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
   3: ide::runnables::runnables
   4: ide::annotations::annotations
   5: ra_salsa::Cancelled::catch
   6: ide::Analysis::annotations
   7: rust_analyzer::handlers::request::handle_code_lens
   8: std::panic::catch_unwind
   9: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 2:19:45 PM] Request textDocument/codeLens failed.
  Message: request handler panicked: tried adding a runnable pointing to a different file: TestMod { path: "" } for FileId(2014)
  Code: -32603 
Panic context:
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

Successfully merging a pull request may close this issue.

2 participants