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

ice: closure: index out of bounds: the len is 4 but the index is 4 #16288

Closed
matthiaskrgr opened this issue Jan 6, 2024 · 3 comments
Closed
Labels
A-ty type system / type inference / traits / method resolution C-bug Category: bug I-panic

Comments

@matthiaskrgr
Copy link
Member

rust-analyzer 1.77.0-nightly (595bc6f 2024-01-05)
rust-analyzer highlight < a.rs

impl ConstPropagator {
    fn eval_rvalue_with_identities(&mut self, rvalue: &Rvalue) {
        self.use_ecx(|this| match rvalue {
            Rvalue::BinaryOp(op, box (left)) => {}
        })
    }
}
thread 'main' panicked at crates/hir-ty/src/infer/closure.rs:682:68:
index out of bounds: the len is 4 but the index is 4
stack backtrace:
   0: rust_begin_unwind
             at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/core/src/panicking.rs:72:14
   2: core::panicking::panic_bounds_check
             at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/core/src/panicking.rs:208:5
   3: <hir_ty::infer::InferenceContext>::walk_pat_inner::<<hir_ty::infer::InferenceContext>::walk_pat::{closure#0}>
   4: <hir_ty::infer::InferenceContext>::walk_pat_inner::<<hir_ty::infer::InferenceContext>::walk_pat::{closure#0}>
   5: <hir_ty::infer::InferenceContext>::walk_expr_without_adjust
   6: <hir_ty::infer::InferenceContext>::walk_expr
   7: <hir_ty::infer::InferenceContext>::analyze_closure
   8: hir_ty::infer::infer_query
   9: <salsa::derived::slot::Slot<hir_ty::db::InferQueryQuery, salsa::derived::AlwaysMemoizeValue>>::execute
  10: <_ as hir_ty::db::HirDatabase>::infer_query::__shim
  11: hir_ty::db::infer_wait
  12: <hir::Local>::ty
  13: ide::syntax_highlighting::highlight::highlight_def
  14: ide::syntax_highlighting::highlight
  15: <ide::Analysis>::highlight_as_html
  16: <rust_analyzer::cli::flags::Highlight>::run
  17: rust_analyzer::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@matthiaskrgr matthiaskrgr added the C-bug Category: bug label Jan 6, 2024
@lnicola lnicola added A-ty type system / type inference / traits / method resolution I-panic labels Jan 6, 2024
@Veykril
Copy link
Member

Veykril commented Jan 6, 2024

box patterns are still a thing?

@matthiaskrgr
Copy link
Member Author

the box_pattern feature gate still exists it seems.

@matthiaskrgr matthiaskrgr mentioned this issue Jan 6, 2024
@Veykril
Copy link
Member

Veykril commented Jul 7, 2024

This no longer triggers

@Veykril Veykril closed this as completed Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ty type system / type inference / traits / method resolution C-bug Category: bug I-panic
Projects
None yet
Development

No branches or pull requests

3 participants