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: assertion failed 2 == 3 [Type, Type, Type] #16286

Closed
matthiaskrgr opened this issue Jan 6, 2024 · 0 comments · Fixed by #17891
Closed

ice: assertion failed 2 == 3 [Type, Type, Type] #16286

matthiaskrgr opened this issue Jan 6, 2024 · 0 comments · Fixed by #17891
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)

#[lang="shr"]
pub trait Shr<RHS,Result> {
    fn shr(&self, rhs: &RHS) -> Result;
}

macro_rules! shr_impl(
    ($($t:ty)*) => ($(
        impl Shr<$t, $t> for $t {
            fn shr -> $t { (*self) >>  }
        }
    )*)
)

shr_impl!(u8)

rust-analyzer highlight < a.rs

thread 'main' panicked at crates/hir-ty/src/builder.rs:66:9:
assertion `left == right` failed: [Type, Type, Type]
  left: 2
 right: 3
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::assert_failed_inner
             at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/core/src/panicking.rs:337:23
   3: core::panicking::assert_failed::<usize, usize>
   4: <hir_ty::builder::TyBuilder<()>>::build
   5: <hir_ty::infer::InferenceContext>::infer_overloadable_binop
   6: <hir_ty::infer::InferenceContext>::infer_expr_inner
   7: <hir_ty::infer::InferenceContext>::infer_expr_coerce
   8: <hir_ty::infer::InferenceContext>::infer_block
   9: <hir_ty::infer::InferenceContext>::infer_expr_inner
  10: <hir_ty::infer::InferenceContext>::infer_return
  11: hir_ty::infer::infer_query
  12: <salsa::derived::slot::Slot<hir_ty::db::InferQueryQuery, salsa::derived::AlwaysMemoizeValue>>::execute
  13: <_ as hir_ty::db::HirDatabase>::infer_query::__shim
  14: hir_ty::db::infer_wait
  15: <hir::semantics::SemanticsImpl>::analyze_impl
  16: <hir::semantics::SemanticsImpl>::resolve_path
  17: <ide_db::defs::NameRefClass>::classify
  18: ide::syntax_highlighting::highlight
  19: <ide::Analysis>::highlight_as_html
  20: <rust_analyzer::cli::flags::Highlight>::run
  21: 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
@matthiaskrgr matthiaskrgr mentioned this issue Jan 6, 2024
@bors bors closed this as completed in 36a071c Aug 14, 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
2 participants