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

thread 'Worker' panicked at 'assertion failed: start <= end', /github/home/.cargo/registry/src/6github.com-1ecc6299db9ec823/text-size-1.1.0/src/range.rs:48:9 #13323

Closed
bjorn3 opened this issue Oct 1, 2022 · 1 comment · Fixed by #13324
Labels
A-completion autocompletion C-bug Category: bug

Comments

@bjorn3
Copy link
Member

bjorn3 commented Oct 1, 2022

#[allow(non_upper_case_globals)]
pub mod kw {
    macro_rules! define_keywords {
        ($($kw:ident)*) => {
            $(
                pub const $kw: &str = stringify!($kw);
            )*
        };
    }

    define_keywords! {
        auto
        break
        case
        char
        const
        continue
        default
        do
        double
        else
        enum
        extern
    }
}

pub fn escape_string(s: &str) -> String {
    format!("{:?}", s) // FIXME use actual C escaping rules
}

while extending the list of keywords in define_keywords! {}. The panics are fully deterministic and happens even after restarting.

thread 'Worker' panicked at 'assertion failed: start <= end', /github/home/.cargo/registry/src/6github.com-1ecc6299db9ec823/text-size-1.1.0/src/range.rs:48:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
   2: core::panicking::panic
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:48:5
   3: ide_completion::completions::item_list::trait_impl::complete_trait_impl_name
   4: ide_completion::completions
   5: std::panicking::try
   6: rust_analyzer::handlers::handle_completion
   7: std::panicking::try
   8: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 14:17:49] Request textDocument/completion failed.
  Message: request handler panicked: assertion failed: start <= end
  Code: -32603

rust-analyzer version: rust-analyzer version: 0.3.1221-standalone

rustc version: rustc 1.63.0 (4b91a6ea7 2022-08-08)

relevant settings:

@bjorn3 bjorn3 added A-completion autocompletion C-bug Category: bug labels Oct 1, 2022
@Veykril
Copy link
Member

Veykril commented Oct 1, 2022

This doesn't actually panic for me 😕 But I see the cause of why this could panic in the code at least

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion autocompletion C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants