rust-lang / rust-lang/rust-analyzer

highlight: panic: `escaping bound vars in predicate Obligation`

Open
#23,063 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The following code

trait TraitA<'a, 'b, 'c> { type AsA; }
trait TraitB<'a, 'b> { type AsB; }
trait TraitC<'a, 'b, 'c> {}
struct X;
struct Y;
struct Z;

fn foo<T>() where for<const N: u8 = { T::<0>::A as u8 + TraitB<'a, 'b, AsB: for<'c> TraitC<'a, 'b, 'c>>::B as u8 }> T: TraitA<'a, AsA: for<'b> TraitB<'a, 'b, AsB: for<'c> TraitC<'a, 'b, 'c>>> {  div(())  }

fn main() {}

crashes rust-analyzer highlight:


thread 'main' (2314592) panicked at crates/hir-ty/src/infer/unify.rs:419:13:
escaping bound vars in predicate Obligation { cause: ObligationCause { span: ExprId(Idx::<Expr>(2)) }, param_env: ParamEnv { clauses: [Clause(Binder { value: TraitPredicate(Alias(AliasTy { args: [Alias(AliasTy { args: [#0, '{region error}, '{region error}, '{region error}], kind: Projection { def_id: TypeAliasId("AsA") }, .. }), '{region error}, '^0.Named(FunctionId("foo"))], kind: Projection { def_id: TypeAliasId("AsB") }, .. }): TraitC<['{region error}, '^1_0.Named(FunctionId("foo")), '^0.Named(FunctionId("foo"))]>, polarity:Positive), bound_vars: [Region(BrNamed(FunctionId("foo")))] }), Clause(Binder { value: TraitPredicate(Alias(AliasTy { args: [#0, '{region error}, '{region error}, '{region error}], kind: Projection { def_id: TypeAliasId("AsA") }, .. }): TraitB<['{region error}, '^0.Named(FunctionId("foo"))]>, polarity:Positive), bound_vars: [Region(BrNamed(FunctionId("foo")))] }), Clause(Binder { value: TraitPredicate(#0: TraitA<['{region error}, '{region error}, '{region error}]>, polarity:Positive), bound_vars: [] })] }, predicate: Binder { value: WellFormed({type error}), bound_vars: [] }, recursion_depth: 0 }
stack backtrace:
   0:     0x55dba9ffb12a - std[1d42cb0d866aa333]::backtrace_rs::backtrace::libunwind::trace
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
   1:     0x55dba9ffb12a - std[1d42cb0d866aa333]::backtrace_rs::backtrace::trace_unsynchronized::<std[1d42cb0d866aa333]::sys::backtrace::_print_fmt::{closure#1}>
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   2:     0x55dba9ffb12a - std[1d42cb0d866aa333]::sys::backtrace::_print_fmt
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/sys/backtrace.rs:74:9
   3:     0x55dba9ffb12a - <<std[1d42cb0d866aa333]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[4e7ceada952a6ea0]::fmt::Display>::fmt
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/sys/backtrace.rs:44:26
   4:     0x55dba885740a - <core[4e7ceada952a6ea0]::fmt::rt::Argument>::fmt
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/core/src/fmt/rt.rs:152:76
   5:     0x55dba885740a - core[4e7ceada952a6ea0]::fmt::write
   6:     0x55dbaa00793c - core[4e7ceada952a6ea0]::io::write::default_write_fmt::<std[1d42cb0d866aa333]::sys::stdio::unix::Stderr>
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/core/src/io/write.rs:402:11
   7:     0x55dbaa00793c - <std[1d42cb0d866aa333]::sys::stdio::unix::Stderr as core[4e7ceada952a6ea0]::io::write::Write>::write_fmt
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/core/src/io/write.rs:335:13
   8:     0x55dba9fd2d64 - <std[1d42cb0d866aa333]::sys::backtrace::BacktraceLock>::print
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/sys/backtrace.rs:47:9
   9:     0x55dba9fd2d64 - std[1d42cb0d866aa333]::panicking::default_hook::{closure#0}
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/panicking.rs:292:27
  10:     0x55dba9ff0936 - std[1d42cb0d866aa333]::panicking::default_hook
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/panicking.rs:319:9
  11:     0x55dba9ff0d92 - std[1d42cb0d866aa333]::panicking::panic_with_hook
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/panicking.rs:815:13
  12:     0x55dba9fd2e12 - std[1d42cb0d866aa333]::panicking::panic_handler::{closure#0}
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/panicking.rs:688:13
  13:     0x55dba9fca9a9 - std[1d42cb0d866aa333]::sys::backtrace::__rust_end_short_backtrace::<std[1d42cb0d866aa333]::panicking::panic_handler::{closure#0}, !>
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/sys/backtrace.rs:182:18
  14:     0x55dba9fd3c5f - __rustc[e79ffd21e4789ee5]::rust_begin_unwind
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/panicking.rs:679:5
  15:     0x55dba8857b6c - core[4e7ceada952a6ea0]::panicking::panic_fmt
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/core/src/panicking.rs:80:14
  16:     0x55dba8ea21eb - <hir_ty[b563eb2393bac861]::infer::InferenceContext>::infer_call
  17:     0x55dba8e92978 - <hir_ty[b563eb2393bac861]::infer::InferenceContext>::infer_expr_inner::{closure#0}
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/infer/expr.rs:443:53
  18:     0x55dba8e92978 - <hir_ty[b563eb2393bac861]::infer::InferenceContext>::infer_expr_inner
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/infer/expr.rs:320:5
  19:     0x55dba8e9276d - <hir_ty[b563eb2393bac861]::infer::InferenceContext>::infer_block::{closure#0}::{closure#2}
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/infer/expr.rs:1581:45
  20:     0x55dba8e9276d - <core[4e7ceada952a6ea0]::option::Option<la_arena[51da2eccfb444eab]::Idx<hir_def[f708e5f07215765]::hir::Expr>>>::map::<(la_arena[51da2eccfb444eab]::Idx<hir_def[f708e5f07215765]::hir::Expr>, hir_ty[b563eb2393bac861]::next_solver::ty::Ty), <hir_ty[b563eb2393bac861]::infer::InferenceContext>::infer_block::{closure#0}::{closure#2}>
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:1163:29
  21:     0x55dba8e9276d - <hir_ty[b563eb2393bac861]::infer::InferenceContext>::infer_block::{closure#0}
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/infer/expr.rs:1581:22
  22:     0x55dba8e9276d - <hir_ty[b563eb2393bac861]::infer::InferenceContext>::with_breakable_ctx::<core[4e7ceada952a6ea0]::option::Option<(la_arena[51da2eccfb444eab]::Idx<hir_def[f708e5f07215765]::hir::Expr>, hir_ty[b563eb2393bac861]::next_solver::ty::Ty)>, <hir_ty[b563eb2393bac861]::infer::InferenceContext>::infer_block::{closure#0}>
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/infer/expr.rs:2208:19
  23:     0x55dba8e9276d - <hir_ty[b563eb2393bac861]::infer::InferenceContext>::infer_block
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/infer/expr.rs:1512:18
  24:     0x55dba8e9276d - <hir_ty[b563eb2393bac861]::infer::InferenceContext>::infer_expr_inner::{closure#0}
  25:     0x55dba8e9276d - <hir_ty[b563eb2393bac861]::infer::InferenceContext>::infer_expr_inner
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/infer/expr.rs:320:5
  26:     0x55dba8e90207 - <hir_ty[b563eb2393bac861]::infer::InferenceContext>::infer_return
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/infer/expr.rs:1433:18
  27:     0x55dba8fb37ef - <hir_ty[b563eb2393bac861]::infer::InferenceContext>::infer_body
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/infer.rs:1892:29
  28:     0x55dba8fb37ef - hir_ty[b563eb2393bac861]::infer::infer_query_with_inspect
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/infer.rs:182:9
  29:     0x55dba8e73978 - hir_ty[b563eb2393bac861]::infer::infer_query
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/infer.rs:123:5
  30:     0x55dba8e73978 - <hir_ty[b563eb2393bac861]::infer::InferenceResult as <hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::InnerTrait_>::for_body_
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/infer.rs:1086:9
  31:     0x55dba8e73978 - <<hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::_::for_body__Configuration_ as salsa[30c92b6da94779f0]::function::Configuration>::execute::inner_
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/infer.rs:1082:1
  32:     0x55dba8e73978 - <<hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::_::for_body__Configuration_ as salsa[30c92b6da94779f0]::function::Configuration>::execute
                               at /home/matthias/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/salsa-macro-rules-0.28.2/src/setup_tracked_fn.rs:350:21
  33:     0x55dba8e73978 - <salsa[30c92b6da94779f0]::function::IngredientImpl<<hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::_::for_body__Configuration_>>::execute_query
                               at /home/matthias/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/salsa-0.28.2/src/function/execute.rs:335:25
  34:     0x55dba8e73978 - <salsa[30c92b6da94779f0]::function::IngredientImpl<<hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::_::for_body__Configuration_>>::execute_maybe_iterate
                               at /home/matthias/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/salsa-0.28.2/src/function/execute.rs:179:49
  35:     0x55dba8e73978 - <salsa[30c92b6da94779f0]::function::IngredientImpl<<hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::_::for_body__Configuration_>>::execute
                               at /home/matthias/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/salsa-0.28.2/src/function/execute.rs:73:22
  36:     0x55dba8c74894 - <salsa[30c92b6da94779f0]::function::IngredientImpl<<hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::_::for_body__Configuration_>>::fetch_cold
                               at /home/matthias/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/salsa-0.28.2/src/function/fetch.rs:157:14
  37:     0x55dba8c74894 - <salsa[30c92b6da94779f0]::function::IngredientImpl<<hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::_::for_body__Configuration_>>::refresh_memo
                               at /home/matthias/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/salsa-0.28.2/src/function/fetch.rs:69:38
  38:     0x55dba8c74894 - <salsa[30c92b6da94779f0]::function::IngredientImpl<<hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::_::for_body__Configuration_>>::fetch
                               at /home/matthias/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/salsa-0.28.2/src/function/fetch.rs:29:25
  39:     0x55dba8c74894 - <hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::for_body_::{closure#0}
                               at /home/matthias/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/salsa-macro-rules-0.28.2/src/setup_tracked_fn.rs:110:66
  40:     0x55dba8c74894 - <salsa[30c92b6da94779f0]::attach::Attached>::attach::<dyn hir_ty[b563eb2393bac861]::db::HirDatabase, &hir_ty[b563eb2393bac861]::infer::InferenceResult, <hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::for_body_::{closure#0}>
                               at /home/matthias/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/salsa-0.28.2/src/attach.rs:88:9
  41:     0x55dba88f09f1 - salsa[30c92b6da94779f0]::attach::attach::<&hir_ty[b563eb2393bac861]::infer::InferenceResult, dyn hir_ty[b563eb2393bac861]::db::HirDatabase, <hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::for_body_::{closure#0}>::{closure#0}
                               at /home/matthias/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/salsa-0.28.2/src/attach.rs:178:15
  42:     0x55dba88f09f1 - <std[1d42cb0d866aa333]::thread::local::LocalKey<salsa[30c92b6da94779f0]::attach::Attached>>::try_with::<salsa[30c92b6da94779f0]::attach::attach<&hir_ty[b563eb2393bac861]::infer::InferenceResult, dyn hir_ty[b563eb2393bac861]::db::HirDatabase, <hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::for_body_::{closure#0}>::{closure#0}, &hir_ty[b563eb2393bac861]::infer::InferenceResult>
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:464:12
  43:     0x55dba88f09f1 - <std[1d42cb0d866aa333]::thread::local::LocalKey<salsa[30c92b6da94779f0]::attach::Attached>>::with::<salsa[30c92b6da94779f0]::attach::attach<&hir_ty[b563eb2393bac861]::infer::InferenceResult, dyn hir_ty[b563eb2393bac861]::db::HirDatabase, <hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::for_body_::{closure#0}>::{closure#0}, &hir_ty[b563eb2393bac861]::infer::InferenceResult>
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:428:20
  44:     0x55dba88f09f1 - salsa[30c92b6da94779f0]::attach::attach::<&hir_ty[b563eb2393bac861]::infer::InferenceResult, dyn hir_ty[b563eb2393bac861]::db::HirDatabase, <hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::for_body_::{closure#0}>
                               at /home/matthias/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/salsa-0.28.2/src/attach.rs:176:14
  45:     0x55dba88f09f1 - <hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body::for_body_
                               at /home/matthias/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/salsa-macro-rules-0.28.2/src/setup_tracked_fn.rs:100:13
  46:     0x55dba88f09f1 - <hir_ty[b563eb2393bac861]::infer::InferenceResult>::for_body
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/infer.rs:1082:1
  47:     0x55dba88f09f1 - <hir_ty[b563eb2393bac861]::infer::InferenceResult>::of::<hir_def[f708e5f07215765]::DefWithBodyId>
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/infer.rs:1107:47
  48:     0x55dba88f09f1 - <hir[b47ea024ca6ff640]::semantics::SemanticsImpl>::with_all_infers_for_store
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir/src/semantics.rs:2255:26
  49:     0x55dba88f09f1 - <hir[b47ea024ca6ff640]::semantics::SemanticsImpl>::get_unsafe_ops
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir/src/semantics.rs:1981:14
  50:     0x55dba926bef4 - ide[fd7c965e2413c177]::syntax_highlighting::traverse::{closure#2}
                               at /home/matthias/vcs/github/rust-analyzer/crates/ide/src/syntax_highlighting.rs:430:41
  51:     0x55dba926bef4 - <std[1d42cb0d866aa333]::collections::hash::map::Entry<hir[b47ea024ca6ff640]::ExpressionStoreOwner, std[1d42cb0d866aa333]::collections::hash::set::HashSet<hir_expand[f269a63487489d89]::files::InFileWrapper<hir_expand[f269a63487489d89]::HirFileId, syntax[72f9dde47abd8ce8]::ptr::AstPtr<either[d93ffe9fe31539e8]::Either<syntax[72f9dde47abd8ce8]::ast::generated::nodes::Expr, syntax[72f9dde47abd8ce8]::ast::generated::nodes::Pat>>>, rustc_hash[3a462df9bfa7ed84]::FxBuildHasher>>>::or_insert_with::<ide[fd7c965e2413c177]::syntax_highlighting::traverse::{closure#2}>::{closure#0}
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/map.rs:2541:55
  52:     0x55dba926bef4 - <std[1d42cb0d866aa333]::collections::hash::map::Entry<hir[b47ea024ca6ff640]::ExpressionStoreOwner, std[1d42cb0d866aa333]::collections::hash::set::HashSet<hir_expand[f269a63487489d89]::files::InFileWrapper<hir_expand[f269a63487489d89]::HirFileId, syntax[72f9dde47abd8ce8]::ptr::AstPtr<either[d93ffe9fe31539e8]::Either<syntax[72f9dde47abd8ce8]::ast::generated::nodes::Expr, syntax[72f9dde47abd8ce8]::ast::generated::nodes::Pat>>>, rustc_hash[3a462df9bfa7ed84]::FxBuildHasher>>>::or_try_insert_with::<<std[1d42cb0d866aa333]::collections::hash::map::Entry<hir[b47ea024ca6ff640]::ExpressionStoreOwner, std[1d42cb0d866aa333]::collections::hash::set::HashSet<hir_expand[f269a63487489d89]::files::InFileWrapper<hir_expand[f269a63487489d89]::HirFileId, syntax[72f9dde47abd8ce8]::ptr::AstPtr<either[d93ffe9fe31539e8]::Either<syntax[72f9dde47abd8ce8]::ast::generated::nodes::Expr, syntax[72f9dde47abd8ce8]::ast::generated::nodes::Pat>>>, rustc_hash[3a462df9bfa7ed84]::FxBuildHasher>>>::or_insert_with<ide[fd7c965e2413c177]::syntax_highlighting::traverse::{closure#2}>::{closure#0}, !>
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/map.rs:2576:46
  53:     0x55dba926bef4 - <std[1d42cb0d866aa333]::collections::hash::map::Entry<hir[b47ea024ca6ff640]::ExpressionStoreOwner, std[1d42cb0d866aa333]::collections::hash::set::HashSet<hir_expand[f269a63487489d89]::files::InFileWrapper<hir_expand[f269a63487489d89]::HirFileId, syntax[72f9dde47abd8ce8]::ptr::AstPtr<either[d93ffe9fe31539e8]::Either<syntax[72f9dde47abd8ce8]::ast::generated::nodes::Expr, syntax[72f9dde47abd8ce8]::ast::generated::nodes::Pat>>>, rustc_hash[3a462df9bfa7ed84]::FxBuildHasher>>>::or_insert_with::<ide[fd7c965e2413c177]::syntax_highlighting::traverse::{closure#2}>
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/map.rs:2541:14
  54:     0x55dba926bef4 - ide[fd7c965e2413c177]::syntax_highlighting::traverse
                               at /home/matthias/vcs/github/rust-analyzer/crates/ide/src/syntax_highlighting.rs:430:18
  55:     0x55dba926bef4 - ide[fd7c965e2413c177]::syntax_highlighting::highlight
                               at /home/matthias/vcs/github/rust-analyzer/crates/ide/src/syntax_highlighting.rs:222:5
  56:     0x55dba92aa419 - ide[fd7c965e2413c177]::syntax_highlighting::html::highlight_as_html_with_config
                               at /home/matthias/vcs/github/rust-analyzer/crates/ide/src/syntax_highlighting/html.rs:34:21
  57:     0x55dba921130c - ide[fd7c965e2413c177]::syntax_highlighting::html::highlight_as_html
                               at /home/matthias/vcs/github/rust-analyzer/crates/ide/src/syntax_highlighting/html.rs:60:5
  58:     0x55dba921130c - <ide[fd7c965e2413c177]::Analysis>::highlight_as_html::{closure#0}
                               at /home/matthias/vcs/github/rust-analyzer/crates/ide/src/lib.rs:778:27
  59:     0x55dba921130c - <ide[fd7c965e2413c177]::Analysis>::with_db::<<ide[fd7c965e2413c177]::Analysis>::highlight_as_html::{closure#0}, alloc[571f99e20346f6ba]::string::String>::{closure#0}::{closure#0}
                               at /home/matthias/vcs/github/rust-analyzer/crates/ide/src/lib.rs:975:70
  60:     0x55dba921130c - std[1d42cb0d866aa333]::panicking::catch_unwind::do_call::<<ide[fd7c965e2413c177]::Analysis>::with_db<<ide[fd7c965e2413c177]::Analysis>::highlight_as_html::{closure#0}, alloc[571f99e20346f6ba]::string::String>::{closure#0}::{closure#0}, alloc[571f99e20346f6ba]::string::String>
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:576:43
  61:     0x55dba921130c - std[1d42cb0d866aa333]::panicking::catch_unwind::<alloc[571f99e20346f6ba]::string::String, <ide[fd7c965e2413c177]::Analysis>::with_db<<ide[fd7c965e2413c177]::Analysis>::highlight_as_html::{closure#0}, alloc[571f99e20346f6ba]::string::String>::{closure#0}::{closure#0}>
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:544:19
  62:     0x55dba921130c - std[1d42cb0d866aa333]::panic::catch_unwind::<<ide[fd7c965e2413c177]::Analysis>::with_db<<ide[fd7c965e2413c177]::Analysis>::highlight_as_html::{closure#0}, alloc[571f99e20346f6ba]::string::String>::{closure#0}::{closure#0}, alloc[571f99e20346f6ba]::string::String>
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:359:14
  63:     0x55dba921130c - <salsa[30c92b6da94779f0]::cancelled::Cancelled>::catch::<<ide[fd7c965e2413c177]::Analysis>::with_db<<ide[fd7c965e2413c177]::Analysis>::highlight_as_html::{closure#0}, alloc[571f99e20346f6ba]::string::String>::{closure#0}::{closure#0}, alloc[571f99e20346f6ba]::string::String>
                               at /home/matthias/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/salsa-0.28.2/src/cancelled.rs:36:15
  64:     0x55dba921130c - <ide[fd7c965e2413c177]::Analysis>::with_db::<<ide[fd7c965e2413c177]::Analysis>::highlight_as_html::{closure#0}, alloc[571f99e20346f6ba]::string::String>::{closure#0}
                               at /home/matthias/vcs/github/rust-analyzer/crates/ide/src/lib.rs:975:50
  65:     0x55dba921130c - <hir_ty[b563eb2393bac861]::next_solver::interner::tls_db::Attached>::attach_allow_change::<core[4e7ceada952a6ea0]::result::Result<alloc[571f99e20346f6ba]::string::String, salsa[30c92b6da94779f0]::cancelled::Cancelled>, <ide[fd7c965e2413c177]::Analysis>::with_db<<ide[fd7c965e2413c177]::Analysis>::highlight_as_html::{closure#0}, alloc[571f99e20346f6ba]::string::String>::{closure#0}>
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/next_solver/interner.rs:2474:13
  66:     0x55dba921130c - hir_ty[b563eb2393bac861]::next_solver::interner::tls_db::attach_db_allow_change::<core[4e7ceada952a6ea0]::result::Result<alloc[571f99e20346f6ba]::string::String, salsa[30c92b6da94779f0]::cancelled::Cancelled>, <ide[fd7c965e2413c177]::Analysis>::with_db<<ide[fd7c965e2413c177]::Analysis>::highlight_as_html::{closure#0}, alloc[571f99e20346f6ba]::string::String>::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/next_solver/interner.rs:2497:46
  67:     0x55dba921130c - <std[1d42cb0d866aa333]::thread::local::LocalKey<hir_ty[b563eb2393bac861]::next_solver::interner::tls_db::Attached>>::try_with::<hir_ty[b563eb2393bac861]::next_solver::interner::tls_db::attach_db_allow_change<core[4e7ceada952a6ea0]::result::Result<alloc[571f99e20346f6ba]::string::String, salsa[30c92b6da94779f0]::cancelled::Cancelled>, <ide[fd7c965e2413c177]::Analysis>::with_db<<ide[fd7c965e2413c177]::Analysis>::highlight_as_html::{closure#0}, alloc[571f99e20346f6ba]::string::String>::{closure#0}>::{closure#0}, core[4e7ceada952a6ea0]::result::Result<alloc[571f99e20346f6ba]::string::String, salsa[30c92b6da94779f0]::cancelled::Cancelled>>
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:464:12
  68:     0x55dba921130c - <std[1d42cb0d866aa333]::thread::local::LocalKey<hir_ty[b563eb2393bac861]::next_solver::interner::tls_db::Attached>>::with::<hir_ty[b563eb2393bac861]::next_solver::interner::tls_db::attach_db_allow_change<core[4e7ceada952a6ea0]::result::Result<alloc[571f99e20346f6ba]::string::String, salsa[30c92b6da94779f0]::cancelled::Cancelled>, <ide[fd7c965e2413c177]::Analysis>::with_db<<ide[fd7c965e2413c177]::Analysis>::highlight_as_html::{closure#0}, alloc[571f99e20346f6ba]::string::String>::{closure#0}>::{closure#0}, core[4e7ceada952a6ea0]::result::Result<alloc[571f99e20346f6ba]::string::String, salsa[30c92b6da94779f0]::cancelled::Cancelled>>
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:428:20
  69:     0x55dba921130c - hir_ty[b563eb2393bac861]::next_solver::interner::tls_db::attach_db_allow_change::<core[4e7ceada952a6ea0]::result::Result<alloc[571f99e20346f6ba]::string::String, salsa[30c92b6da94779f0]::cancelled::Cancelled>, <ide[fd7c965e2413c177]::Analysis>::with_db<<ide[fd7c965e2413c177]::Analysis>::highlight_as_html::{closure#0}, alloc[571f99e20346f6ba]::string::String>::{closure#0}>
                               at /home/matthias/vcs/github/rust-analyzer/crates/hir-ty/src/next_solver/interner.rs:2497:19
  70:     0x55dba921130c - <ide[fd7c965e2413c177]::Analysis>::with_db::<<ide[fd7c965e2413c177]::Analysis>::highlight_as_html::{closure#0}, alloc[571f99e20346f6ba]::string::String>
                               at /home/matthias/vcs/github/rust-analyzer/crates/ide/src/lib.rs:975:9
  71:     0x55dba921130c - <ide[fd7c965e2413c177]::Analysis>::highlight_as_html
                               at /home/matthias/vcs/github/rust-analyzer/crates/ide/src/lib.rs:778:14
  72:     0x55dba9cf38c1 - <rust_analyzer[28cadc03f27f6f75]::cli::flags::Highlight>::run
                               at /home/matthias/vcs/github/rust-analyzer/crates/rust-analyzer/src/cli/highlight.rs:13:29
  73:     0x55dba9f4d216 - rust_analyzer[54859656eebe60bb]::actual_main
                               at /home/matthias/vcs/github/rust-analyzer/crates/rust-analyzer/src/bin/main.rs:73:55
  74:     0x55dba9f4d216 - rust_analyzer[54859656eebe60bb]::main
                               at /home/matthias/vcs/github/rust-analyzer/crates/rust-analyzer/src/bin/main.rs:32:9
  75:     0x55dba9f48fc3 - <fn() -> core[4e7ceada952a6ea0]::result::Result<std[1d42cb0d866aa333]::process::ExitCode, anyhow[9e7f18bf7b4e203c]::Error> as core[4e7ceada952a6ea0]::ops::function::FnOnce<()>>::call_once
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
  76:     0x55dba9f48fc3 - std[1d42cb0d866aa333]::sys::backtrace::__rust_begin_short_backtrace::<fn() -> core[4e7ceada952a6ea0]::result::Result<std[1d42cb0d866aa333]::process::ExitCode, anyhow[9e7f18bf7b4e203c]::Error>, core[4e7ceada952a6ea0]::result::Result<std[1d42cb0d866aa333]::process::ExitCode, anyhow[9e7f18bf7b4e203c]::Error>>
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:166:18
  77:     0x55dba9f4b232 - std[1d42cb0d866aa333]::rt::lang_start::<core[4e7ceada952a6ea0]::result::Result<std[1d42cb0d866aa333]::process::ExitCode, anyhow[9e7f18bf7b4e203c]::Error>>::{closure#0}
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:206:18
  78:     0x55dba9fef763 - <&dyn core[4e7ceada952a6ea0]::ops::function::Fn<(), Output = i32> + core[4e7ceada952a6ea0]::marker::Sync + core[4e7ceada952a6ea0]::panic::unwind_safe::RefUnwindSafe as core[4e7ceada952a6ea0]::ops::function::FnOnce<()>>::call_once
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/core/src/ops/function.rs:287:21
  79:     0x55dba9fef763 - std[1d42cb0d866aa333]::panicking::catch_unwind::do_call::<&dyn core[4e7ceada952a6ea0]::ops::function::Fn<(), Output = i32> + core[4e7ceada952a6ea0]::marker::Sync + core[4e7ceada952a6ea0]::panic::unwind_safe::RefUnwindSafe, i32>
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/panicking.rs:576:43
  80:     0x55dba9fef763 - std[1d42cb0d866aa333]::panicking::catch_unwind::<i32, &dyn core[4e7ceada952a6ea0]::ops::function::Fn<(), Output = i32> + core[4e7ceada952a6ea0]::marker::Sync + core[4e7ceada952a6ea0]::panic::unwind_safe::RefUnwindSafe>
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/panicking.rs:544:19
  81:     0x55dba9fef763 - std[1d42cb0d866aa333]::panic::catch_unwind::<&dyn core[4e7ceada952a6ea0]::ops::function::Fn<(), Output = i32> + core[4e7ceada952a6ea0]::marker::Sync + core[4e7ceada952a6ea0]::panic::unwind_safe::RefUnwindSafe, i32>
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/panic.rs:359:14
  82:     0x55dba9fef763 - std[1d42cb0d866aa333]::rt::lang_start_internal::{closure#0}
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/rt.rs:175:24
  83:     0x55dba9fef763 - std[1d42cb0d866aa333]::panicking::catch_unwind::do_call::<std[1d42cb0d866aa333]::rt::lang_start_internal::{closure#0}, isize>
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/panicking.rs:576:43
  84:     0x55dba9fef763 - std[1d42cb0d866aa333]::panicking::catch_unwind::<isize, std[1d42cb0d866aa333]::rt::lang_start_internal::{closure#0}>
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/panicking.rs:544:19
  85:     0x55dba9fef763 - std[1d42cb0d866aa333]::panic::catch_unwind::<std[1d42cb0d866aa333]::rt::lang_start_internal::{closure#0}, isize>
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/panic.rs:359:14
  86:     0x55dba9fef763 - std[1d42cb0d866aa333]::rt::lang_start_internal
                               at /rustc/7608eb7b07eaf93f16d7cf5bcb2098eca87503df/library/std/src/rt.rs:171:5
  87:     0x55dba9f64f1c - main
  88:     0x7f4274a27741 - <unknown>
  89:     0x7f4274a27879 - __libc_start_main
  90:     0x55dba87d0ab5 - _start
  91:                0x0 - <unknown>

version information

rust-analyzer 0.0.0 (ece721d6cd 2026-08-06)

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

Start by reproducing the supplied snippet with rust-analyzer highlight, then inspect crates/hir-ty/src/infer/unify.rs around line 419 and the infer_call path shown in the backtrace. Trace how the escaping bound-variable obligation reaches the panic; done means the reproducer reports diagnostics or highlighting without crashing.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.