rust-lang / rust-lang/rust-analyzer

highlight: panic: `uninferred pattern?`

Open
#23,025 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-ty C-bug I-panic
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

requires debug assertions!

The following code

// Regression test for <https://github.com/rust-lang/rust/issues/141844>.

fn main() {
  // The following expression gets desugared into something like:
  // ```
  // let (lhs,) = x; (let x = 1) = lhs;
  // ```
  // This used to ICE since we haven't yet declared the type for `x` when
  // checking the first desugared statement, whose RHS resolved to `x` since
  // in the AST, the `let` expression was visited first.
  (let x = 1,) = x;
  //~^ ERROR expected expression, found `let` statement
}

crashes rust-analyzer highlight:


thread 'main' (1471019) panicked at src/tools/rust-analyzer/crates/hir-ty/src/infer/path.rs:86:25:
internal error: entered unreachable code: uninferred pattern?
stack backtrace:
   0:     0x7fb7029fb590 - std[5bc4b08caa256f6e]::backtrace_rs::backtrace::libunwind::trace
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
   1:     0x7fb7029fb590 - std[5bc4b08caa256f6e]::backtrace_rs::backtrace::trace_unsynchronized::<std[5bc4b08caa256f6e]::sys::backtrace::_print_fmt::{closure#1}>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   2:     0x7fb7029fb590 - std[5bc4b08caa256f6e]::sys::backtrace::_print_fmt
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/sys/backtrace.rs:74:9
   3:     0x7fb7029fb590 - <<std[5bc4b08caa256f6e]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[3b1b85d11538b91a]::fmt::Display>::fmt
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/sys/backtrace.rs:44:26
   4:     0x7fb6fe2703ae - <core[3b1b85d11538b91a]::fmt::rt::Argument>::fmt
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/core/src/fmt/rt.rs:152:76
   5:     0x7fb6fe2703ae - core[3b1b85d11538b91a]::fmt::write
   6:     0x7fb702a1250c - core[3b1b85d11538b91a]::io::write::default_write_fmt::<std[5bc4b08caa256f6e]::sys::stdio::unix::Stderr>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/core/src/io/write.rs:402:11
   7:     0x7fb702a1250c - <std[5bc4b08caa256f6e]::sys::stdio::unix::Stderr as core[3b1b85d11538b91a]::io::write::Write>::write_fmt
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/core/src/io/write.rs:335:13
   8:     0x7fb7029ba664 - <std[5bc4b08caa256f6e]::sys::backtrace::BacktraceLock>::print
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/sys/backtrace.rs:47:9
   9:     0x7fb7029ba664 - std[5bc4b08caa256f6e]::panicking::default_hook::{closure#0}
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/panicking.rs:292:27
  10:     0x7fb7029e7a21 - std[5bc4b08caa256f6e]::panicking::default_hook
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/panicking.rs:319:9
  11:     0x7fb7029e7e73 - std[5bc4b08caa256f6e]::panicking::panic_with_hook
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/panicking.rs:815:13
  12:     0x7fb7029ba764 - std[5bc4b08caa256f6e]::panicking::panic_handler::{closure#0}
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/panicking.rs:681:13
  13:     0x7fb7029aaa49 - std[5bc4b08caa256f6e]::sys::backtrace::__rust_end_short_backtrace::<std[5bc4b08caa256f6e]::panicking::panic_handler::{closure#0}, !>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/sys/backtrace.rs:182:18
  14:     0x7fb7029bc70d - __rustc[ec65f6bfcd0b8ba6]::rust_begin_unwind
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/panicking.rs:679:5
  15:     0x7fb6fe27111c - core[3b1b85d11538b91a]::panicking::panic_fmt
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/core/src/panicking.rs:80:14
  16:     0x5624a452f7d6 - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::resolve_value_path
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer/path.rs:86:25
  17:     0x5624a452f7d6 - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::infer_path
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer/path.rs:46:24
  18:     0x5624a4520cf6 - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::infer_expr_path
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs:1277:29
  19:     0x5624a4520cf6 - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::infer_expr_inner::{closure#0}
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs:504:35
  20:     0x5624a4520cf6 - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::infer_expr_inner
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs:309:5
  21:     0x5624a452007e - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::infer_expr
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs:63:23
  22:     0x5624a4523614 - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::infer_expr_inner::{closure#0}
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs:650:39
  23:     0x5624a4523614 - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::infer_expr_inner
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs:309:5
  24:     0x5624a452007e - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::infer_expr
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs:63:23
  25:     0x5624a4521eaf - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::infer_block::{closure#0}
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs:1553:38
  26:     0x5624a4521eaf - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::with_breakable_ctx::<core[3b1b85d11538b91a]::option::Option<(la_arena[5b615cc69c624646]::Idx<hir_def[2230ff9d733fbddc]::hir::Expr>, hir_ty[78931ef0f3460e2e]::next_solver::ty::Ty)>, <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::infer_block::{closure#0}>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs:2190:19
  27:     0x5624a4521eaf - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::infer_block
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs:1499:18
  28:     0x5624a4521eaf - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::infer_expr_inner::{closure#0}
  29:     0x5624a4521eaf - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::infer_expr_inner
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs:309:5
  30:     0x5624a45201d5 - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::infer_return
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs:1420:18
  31:     0x5624a46702bb - <hir_ty[78931ef0f3460e2e]::infer::InferenceContext>::infer_body
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer.rs:1856:29
  32:     0x5624a46702bb - hir_ty[78931ef0f3460e2e]::infer::infer_query_with_inspect
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer.rs:182:9
  33:     0x5624a44fe4d3 - hir_ty[78931ef0f3460e2e]::infer::infer_query
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer.rs:123:5
  34:     0x5624a44fe4d3 - <hir_ty[78931ef0f3460e2e]::infer::InferenceResult as <hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::InnerTrait_>::for_body_
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer.rs:1045:9
  35:     0x5624a44fe4d3 - <<hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::_::for_body__Configuration_ as salsa[6c1f8f7ff407531b]::function::Configuration>::execute::inner_
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer.rs:1041:1
  36:     0x5624a44fe4d3 - <<hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::_::for_body__Configuration_ as salsa[6c1f8f7ff407531b]::function::Configuration>::execute
                               at /rust/deps/salsa-macro-rules-0.27.2/src/setup_tracked_fn.rs:338:21
  37:     0x5624a44fe4d3 - <salsa[6c1f8f7ff407531b]::function::IngredientImpl<<hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::_::for_body__Configuration_>>::execute_query
                               at /rust/deps/salsa-0.27.2/src/function/execute.rs:330:25
  38:     0x5624a44fe4d3 - <salsa[6c1f8f7ff407531b]::function::IngredientImpl<<hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::_::for_body__Configuration_>>::execute_maybe_iterate
                               at /rust/deps/salsa-0.27.2/src/function/execute.rs:170:49
  39:     0x5624a44fe4d3 - <salsa[6c1f8f7ff407531b]::function::IngredientImpl<<hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::_::for_body__Configuration_>>::execute
                               at /rust/deps/salsa-0.27.2/src/function/execute.rs:74:22
  40:     0x5624a4210003 - <salsa[6c1f8f7ff407531b]::function::IngredientImpl<<hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::_::for_body__Configuration_>>::fetch_cold
                               at /rust/deps/salsa-0.27.2/src/function/fetch.rs:150:14
  41:     0x5624a4210003 - <salsa[6c1f8f7ff407531b]::function::IngredientImpl<<hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::_::for_body__Configuration_>>::refresh_memo
                               at /rust/deps/salsa-0.27.2/src/function/fetch.rs:69:38
  42:     0x5624a4210003 - <salsa[6c1f8f7ff407531b]::function::IngredientImpl<<hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::_::for_body__Configuration_>>::fetch
                               at /rust/deps/salsa-0.27.2/src/function/fetch.rs:29:25
  43:     0x5624a4210003 - <hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::for_body_::{closure#0}
                               at /rust/deps/salsa-macro-rules-0.27.2/src/setup_tracked_fn.rs:108:66
  44:     0x5624a4210003 - <salsa[6c1f8f7ff407531b]::attach::Attached>::attach::<dyn hir_ty[78931ef0f3460e2e]::db::HirDatabase, &hir_ty[78931ef0f3460e2e]::infer::InferenceResult, <hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::for_body_::{closure#0}>
                               at /rust/deps/salsa-0.27.2/src/attach.rs:88:9
  45:     0x5624a3deb803 - salsa[6c1f8f7ff407531b]::attach::attach::<&hir_ty[78931ef0f3460e2e]::infer::InferenceResult, dyn hir_ty[78931ef0f3460e2e]::db::HirDatabase, <hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::for_body_::{closure#0}>::{closure#0}
                               at /rust/deps/salsa-0.27.2/src/attach.rs:178:15
  46:     0x5624a3deb803 - <std[5bc4b08caa256f6e]::thread::local::LocalKey<salsa[6c1f8f7ff407531b]::attach::Attached>>::try_with::<salsa[6c1f8f7ff407531b]::attach::attach<&hir_ty[78931ef0f3460e2e]::infer::InferenceResult, dyn hir_ty[78931ef0f3460e2e]::db::HirDatabase, <hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::for_body_::{closure#0}>::{closure#0}, &hir_ty[78931ef0f3460e2e]::infer::InferenceResult>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/thread/local.rs:464:12
  47:     0x5624a3deb803 - <std[5bc4b08caa256f6e]::thread::local::LocalKey<salsa[6c1f8f7ff407531b]::attach::Attached>>::with::<salsa[6c1f8f7ff407531b]::attach::attach<&hir_ty[78931ef0f3460e2e]::infer::InferenceResult, dyn hir_ty[78931ef0f3460e2e]::db::HirDatabase, <hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::for_body_::{closure#0}>::{closure#0}, &hir_ty[78931ef0f3460e2e]::infer::InferenceResult>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/thread/local.rs:428:20
  48:     0x5624a3deb803 - salsa[6c1f8f7ff407531b]::attach::attach::<&hir_ty[78931ef0f3460e2e]::infer::InferenceResult, dyn hir_ty[78931ef0f3460e2e]::db::HirDatabase, <hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::for_body_::{closure#0}>
                               at /rust/deps/salsa-0.27.2/src/attach.rs:176:14
  49:     0x5624a3deb803 - <hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body::for_body_
                               at /rust/deps/salsa-macro-rules-0.27.2/src/setup_tracked_fn.rs:98:13
  50:     0x5624a3deb803 - <hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::for_body
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer.rs:1041:1
  51:     0x5624a3deb803 - <hir_ty[78931ef0f3460e2e]::infer::InferenceResult>::of::<hir_def[2230ff9d733fbddc]::DefWithBodyId>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/infer.rs:1069:47
  52:     0x5624a3deb803 - <hir[a2439b282a3ea4b8]::semantics::SemanticsImpl>::with_all_infers_for_store
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir/src/semantics.rs:2255:26
  53:     0x5624a3deb803 - <hir[a2439b282a3ea4b8]::semantics::SemanticsImpl>::get_unsafe_ops
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir/src/semantics.rs:1981:14
  54:     0x5624a4935a88 - ide[7522228baa251e9a]::syntax_highlighting::traverse::{closure#2}
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting.rs:430:41
  55:     0x5624a4935a88 - <std[5bc4b08caa256f6e]::collections::hash::map::Entry<hir[a2439b282a3ea4b8]::ExpressionStoreOwner, std[5bc4b08caa256f6e]::collections::hash::set::HashSet<hir_expand[9654e838fa00278c]::files::InFileWrapper<hir_expand[9654e838fa00278c]::HirFileId, syntax[6646cc4621a7f916]::ptr::AstPtr<either[3c6a38dcf30a9887]::Either<syntax[6646cc4621a7f916]::ast::generated::nodes::Expr, syntax[6646cc4621a7f916]::ast::generated::nodes::Pat>>>, rustc_hash[cd761141b251c21a]::FxBuildHasher>>>::or_insert_with::<ide[7522228baa251e9a]::syntax_highlighting::traverse::{closure#2}>::{closure#0}
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/collections/hash/map.rs:2541:55
  56:     0x5624a4935a88 - <std[5bc4b08caa256f6e]::collections::hash::map::Entry<hir[a2439b282a3ea4b8]::ExpressionStoreOwner, std[5bc4b08caa256f6e]::collections::hash::set::HashSet<hir_expand[9654e838fa00278c]::files::InFileWrapper<hir_expand[9654e838fa00278c]::HirFileId, syntax[6646cc4621a7f916]::ptr::AstPtr<either[3c6a38dcf30a9887]::Either<syntax[6646cc4621a7f916]::ast::generated::nodes::Expr, syntax[6646cc4621a7f916]::ast::generated::nodes::Pat>>>, rustc_hash[cd761141b251c21a]::FxBuildHasher>>>::or_try_insert_with::<<std[5bc4b08caa256f6e]::collections::hash::map::Entry<hir[a2439b282a3ea4b8]::ExpressionStoreOwner, std[5bc4b08caa256f6e]::collections::hash::set::HashSet<hir_expand[9654e838fa00278c]::files::InFileWrapper<hir_expand[9654e838fa00278c]::HirFileId, syntax[6646cc4621a7f916]::ptr::AstPtr<either[3c6a38dcf30a9887]::Either<syntax[6646cc4621a7f916]::ast::generated::nodes::Expr, syntax[6646cc4621a7f916]::ast::generated::nodes::Pat>>>, rustc_hash[cd761141b251c21a]::FxBuildHasher>>>::or_insert_with<ide[7522228baa251e9a]::syntax_highlighting::traverse::{closure#2}>::{closure#0}, !>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/collections/hash/map.rs:2576:46
  57:     0x5624a4935a88 - <std[5bc4b08caa256f6e]::collections::hash::map::Entry<hir[a2439b282a3ea4b8]::ExpressionStoreOwner, std[5bc4b08caa256f6e]::collections::hash::set::HashSet<hir_expand[9654e838fa00278c]::files::InFileWrapper<hir_expand[9654e838fa00278c]::HirFileId, syntax[6646cc4621a7f916]::ptr::AstPtr<either[3c6a38dcf30a9887]::Either<syntax[6646cc4621a7f916]::ast::generated::nodes::Expr, syntax[6646cc4621a7f916]::ast::generated::nodes::Pat>>>, rustc_hash[cd761141b251c21a]::FxBuildHasher>>>::or_insert_with::<ide[7522228baa251e9a]::syntax_highlighting::traverse::{closure#2}>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/collections/hash/map.rs:2541:14
  58:     0x5624a4935a88 - ide[7522228baa251e9a]::syntax_highlighting::traverse
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting.rs:430:18
  59:     0x5624a4935a88 - ide[7522228baa251e9a]::syntax_highlighting::highlight
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting.rs:222:5
  60:     0x5624a48cd196 - ide[7522228baa251e9a]::syntax_highlighting::html::highlight_as_html_with_config
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/html.rs:34:21
  61:     0x5624a48cd196 - ide[7522228baa251e9a]::syntax_highlighting::html::highlight_as_html
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/html.rs:60:5
  62:     0x5624a48cd196 - <ide[7522228baa251e9a]::Analysis>::highlight_as_html::{closure#0}
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/ide/src/lib.rs:779:27
  63:     0x5624a48cd196 - <ide[7522228baa251e9a]::Analysis>::with_db::<<ide[7522228baa251e9a]::Analysis>::highlight_as_html::{closure#0}, alloc[e6aa54066faa1ed9]::string::String>::{closure#0}::{closure#0}
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/ide/src/lib.rs:976:70
  64:     0x5624a48cd196 - std[5bc4b08caa256f6e]::panicking::catch_unwind::do_call::<<ide[7522228baa251e9a]::Analysis>::with_db<<ide[7522228baa251e9a]::Analysis>::highlight_as_html::{closure#0}, alloc[e6aa54066faa1ed9]::string::String>::{closure#0}::{closure#0}, alloc[e6aa54066faa1ed9]::string::String>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/panicking.rs:576:43
  65:     0x5624a48cd196 - std[5bc4b08caa256f6e]::panicking::catch_unwind::<alloc[e6aa54066faa1ed9]::string::String, <ide[7522228baa251e9a]::Analysis>::with_db<<ide[7522228baa251e9a]::Analysis>::highlight_as_html::{closure#0}, alloc[e6aa54066faa1ed9]::string::String>::{closure#0}::{closure#0}>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/panicking.rs:544:19
  66:     0x5624a48cd196 - std[5bc4b08caa256f6e]::panic::catch_unwind::<<ide[7522228baa251e9a]::Analysis>::with_db<<ide[7522228baa251e9a]::Analysis>::highlight_as_html::{closure#0}, alloc[e6aa54066faa1ed9]::string::String>::{closure#0}::{closure#0}, alloc[e6aa54066faa1ed9]::string::String>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/panic.rs:359:14
  67:     0x5624a48cd196 - <salsa[6c1f8f7ff407531b]::cancelled::Cancelled>::catch::<<ide[7522228baa251e9a]::Analysis>::with_db<<ide[7522228baa251e9a]::Analysis>::highlight_as_html::{closure#0}, alloc[e6aa54066faa1ed9]::string::String>::{closure#0}::{closure#0}, alloc[e6aa54066faa1ed9]::string::String>
                               at /rust/deps/salsa-0.27.2/src/cancelled.rs:36:15
  68:     0x5624a48cd196 - <ide[7522228baa251e9a]::Analysis>::with_db::<<ide[7522228baa251e9a]::Analysis>::highlight_as_html::{closure#0}, alloc[e6aa54066faa1ed9]::string::String>::{closure#0}
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/ide/src/lib.rs:976:50
  69:     0x5624a48cd196 - <hir_ty[78931ef0f3460e2e]::next_solver::interner::tls_db::Attached>::attach_allow_change::<core[3b1b85d11538b91a]::result::Result<alloc[e6aa54066faa1ed9]::string::String, salsa[6c1f8f7ff407531b]::cancelled::Cancelled>, <ide[7522228baa251e9a]::Analysis>::with_db<<ide[7522228baa251e9a]::Analysis>::highlight_as_html::{closure#0}, alloc[e6aa54066faa1ed9]::string::String>::{closure#0}>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/interner.rs:2441:13
  70:     0x5624a48cd196 - hir_ty[78931ef0f3460e2e]::next_solver::interner::tls_db::attach_db_allow_change::<core[3b1b85d11538b91a]::result::Result<alloc[e6aa54066faa1ed9]::string::String, salsa[6c1f8f7ff407531b]::cancelled::Cancelled>, <ide[7522228baa251e9a]::Analysis>::with_db<<ide[7522228baa251e9a]::Analysis>::highlight_as_html::{closure#0}, alloc[e6aa54066faa1ed9]::string::String>::{closure#0}>::{closure#0}
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/interner.rs:2464:46
  71:     0x5624a48cd196 - <std[5bc4b08caa256f6e]::thread::local::LocalKey<hir_ty[78931ef0f3460e2e]::next_solver::interner::tls_db::Attached>>::try_with::<hir_ty[78931ef0f3460e2e]::next_solver::interner::tls_db::attach_db_allow_change<core[3b1b85d11538b91a]::result::Result<alloc[e6aa54066faa1ed9]::string::String, salsa[6c1f8f7ff407531b]::cancelled::Cancelled>, <ide[7522228baa251e9a]::Analysis>::with_db<<ide[7522228baa251e9a]::Analysis>::highlight_as_html::{closure#0}, alloc[e6aa54066faa1ed9]::string::String>::{closure#0}>::{closure#0}, core[3b1b85d11538b91a]::result::Result<alloc[e6aa54066faa1ed9]::string::String, salsa[6c1f8f7ff407531b]::cancelled::Cancelled>>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/thread/local.rs:464:12
  72:     0x5624a48cd196 - <std[5bc4b08caa256f6e]::thread::local::LocalKey<hir_ty[78931ef0f3460e2e]::next_solver::interner::tls_db::Attached>>::with::<hir_ty[78931ef0f3460e2e]::next_solver::interner::tls_db::attach_db_allow_change<core[3b1b85d11538b91a]::result::Result<alloc[e6aa54066faa1ed9]::string::String, salsa[6c1f8f7ff407531b]::cancelled::Cancelled>, <ide[7522228baa251e9a]::Analysis>::with_db<<ide[7522228baa251e9a]::Analysis>::highlight_as_html::{closure#0}, alloc[e6aa54066faa1ed9]::string::String>::{closure#0}>::{closure#0}, core[3b1b85d11538b91a]::result::Result<alloc[e6aa54066faa1ed9]::string::String, salsa[6c1f8f7ff407531b]::cancelled::Cancelled>>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/thread/local.rs:428:20
  73:     0x5624a48cd196 - hir_ty[78931ef0f3460e2e]::next_solver::interner::tls_db::attach_db_allow_change::<core[3b1b85d11538b91a]::result::Result<alloc[e6aa54066faa1ed9]::string::String, salsa[6c1f8f7ff407531b]::cancelled::Cancelled>, <ide[7522228baa251e9a]::Analysis>::with_db<<ide[7522228baa251e9a]::Analysis>::highlight_as_html::{closure#0}, alloc[e6aa54066faa1ed9]::string::String>::{closure#0}>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/hir-ty/src/next_solver/interner.rs:2464:19
  74:     0x5624a48cd196 - <ide[7522228baa251e9a]::Analysis>::with_db::<<ide[7522228baa251e9a]::Analysis>::highlight_as_html::{closure#0}, alloc[e6aa54066faa1ed9]::string::String>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/ide/src/lib.rs:976:9
  75:     0x5624a48cd196 - <ide[7522228baa251e9a]::Analysis>::highlight_as_html
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/ide/src/lib.rs:779:14
  76:     0x5624a5579cb5 - <rust_analyzer[7e5e11b2a2933d2]::cli::flags::Highlight>::run
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/rust-analyzer/src/cli/highlight.rs:13:29
  77:     0x5624a57eb32b - rust_analyzer[adc8391f4d90bc76]::actual_main
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/rust-analyzer/src/bin/main.rs:73:55
  78:     0x5624a57eb32b - rust_analyzer[adc8391f4d90bc76]::main
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/src/tools/rust-analyzer/crates/rust-analyzer/src/bin/main.rs:32:9
  79:     0x5624a57e5e13 - <fn() -> core[3b1b85d11538b91a]::result::Result<std[5bc4b08caa256f6e]::process::ExitCode, anyhow[1ba1579ec8675b12]::Error> as core[3b1b85d11538b91a]::ops::function::FnOnce<()>>::call_once
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/core/src/ops/function.rs:250:5
  80:     0x5624a57e5e13 - std[5bc4b08caa256f6e]::sys::backtrace::__rust_begin_short_backtrace::<fn() -> core[3b1b85d11538b91a]::result::Result<std[5bc4b08caa256f6e]::process::ExitCode, anyhow[1ba1579ec8675b12]::Error>, core[3b1b85d11538b91a]::result::Result<std[5bc4b08caa256f6e]::process::ExitCode, anyhow[1ba1579ec8675b12]::Error>>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/sys/backtrace.rs:166:18
  81:     0x5624a57e82e2 - std[5bc4b08caa256f6e]::rt::lang_start::<core[3b1b85d11538b91a]::result::Result<std[5bc4b08caa256f6e]::process::ExitCode, anyhow[1ba1579ec8675b12]::Error>>::{closure#0}
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/rt.rs:206:18
  82:     0x7fb7029e5adc - <&dyn core[3b1b85d11538b91a]::ops::function::Fn<(), Output = i32> + core[3b1b85d11538b91a]::panic::unwind_safe::RefUnwindSafe + core[3b1b85d11538b91a]::marker::Sync as core[3b1b85d11538b91a]::ops::function::FnOnce<()>>::call_once
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/core/src/ops/function.rs:287:21
  83:     0x7fb7029e5adc - std[5bc4b08caa256f6e]::panicking::catch_unwind::do_call::<&dyn core[3b1b85d11538b91a]::ops::function::Fn<(), Output = i32> + core[3b1b85d11538b91a]::panic::unwind_safe::RefUnwindSafe + core[3b1b85d11538b91a]::marker::Sync, i32>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/panicking.rs:576:43
  84:     0x7fb7029e5adc - std[5bc4b08caa256f6e]::panicking::catch_unwind::<i32, &dyn core[3b1b85d11538b91a]::ops::function::Fn<(), Output = i32> + core[3b1b85d11538b91a]::panic::unwind_safe::RefUnwindSafe + core[3b1b85d11538b91a]::marker::Sync>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/panicking.rs:544:19
  85:     0x7fb7029e5adc - std[5bc4b08caa256f6e]::panic::catch_unwind::<&dyn core[3b1b85d11538b91a]::ops::function::Fn<(), Output = i32> + core[3b1b85d11538b91a]::panic::unwind_safe::RefUnwindSafe + core[3b1b85d11538b91a]::marker::Sync, i32>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/panic.rs:359:14
  86:     0x7fb7029e5adc - std[5bc4b08caa256f6e]::rt::lang_start_internal::{closure#0}
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/rt.rs:175:24
  87:     0x7fb7029e5adc - std[5bc4b08caa256f6e]::panicking::catch_unwind::do_call::<std[5bc4b08caa256f6e]::rt::lang_start_internal::{closure#0}, isize>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/panicking.rs:576:43
  88:     0x7fb7029e5adc - std[5bc4b08caa256f6e]::panicking::catch_unwind::<isize, std[5bc4b08caa256f6e]::rt::lang_start_internal::{closure#0}>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/panicking.rs:544:19
  89:     0x7fb7029e5adc - std[5bc4b08caa256f6e]::panic::catch_unwind::<std[5bc4b08caa256f6e]::rt::lang_start_internal::{closure#0}, isize>
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/panic.rs:359:14
  90:     0x7fb7029e5adc - std[5bc4b08caa256f6e]::rt::lang_start_internal
                               at /rustc/504869653f510b279c542e65ccd1ea9710c119ba/library/std/src/rt.rs:171:5
  91:     0x5624a58028bf - main
  92:     0x7fb6fc827741 - <unknown>
  93:     0x7fb6fc827879 - __libc_start_main
  94:     0x5624a3c8a939 - <unknown>
  95:                0x0 - <unknown>

version information

rust-analyzer 1.99.0-nightly (5048696 2026-08-03)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the panic with the Rust snippet using rust-analyzer highlight, then start at src/tools/rust-analyzer/crates/hir-ty/src/infer/path.rs:86 and follow the resolve_value_path call through infer/expr.rs. Done means this input no longer panics and highlight handles the compiler-error case; the payload does not name a regression-test file.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.