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: self.remaining() > 0 #16287

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

ice: self.remaining() > 0 #16287

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)
rust-analyzer highlight < a.rs

#[lang="eq"]
pub trait Eq {
    fn eq(&self, ) -> bool;
    
}

macro_rules! totaleq_impl(
    ($t:ty) => {
        impl TotalEq for $t {
            #
            fn equals(&self, other: &$t) -> bool { *self == *other }
        }
    }
)


totaleq_impl!(i16)
thread 'main' panicked at crates/hir-ty/src/builder.rs:78:9:
assertion failed: self.remaining() > 0
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
             at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/core/src/panicking.rs:144:5
   3: <hir_ty::builder::TyBuilder<()>>::push::<chalk_ir::Ty<hir_ty::interner::Interner>>
   4: <hir_ty::infer::InferenceContext>::infer_overloadable_binop
   5: <hir_ty::infer::InferenceContext>::infer_expr_inner
   6: <hir_ty::infer::InferenceContext>::infer_expr_coerce
   7: <hir_ty::infer::InferenceContext>::infer_block
   8: <hir_ty::infer::InferenceContext>::infer_expr_inner
   9: <hir_ty::infer::InferenceContext>::infer_return
  10: hir_ty::infer::infer_query
  11: <salsa::derived::slot::Slot<hir_ty::db::InferQueryQuery, salsa::derived::AlwaysMemoizeValue>>::execute
  12: <_ as hir_ty::db::HirDatabase>::infer_query::__shim
  13: hir_ty::db::infer_wait
  14: <hir::semantics::SemanticsImpl>::analyze_impl
  15: <hir::semantics::SemanticsImpl>::resolve_path
  16: <ide_db::defs::NameRefClass>::classify
  17: ide::syntax_highlighting::highlight
  18: <ide::Analysis>::highlight_as_html
  19: <rust_analyzer::cli::flags::Highlight>::run
  20: 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