zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.25k stars 2.73k forks source link

Crash on hovering over error #16058

Closed tinfoil-knight closed 4 weeks ago

tinfoil-knight commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Aside:

Here are my Zed settings:

local settings
{
  "collaboration_panel": {
    "dock": "right"
  },
  "features": {
    "inline_completion_provider": "none"
  },
  "project_panel": {
    "dock": "right"
  },
  "theme": "Ayu Dark",
  "buffer_font_family": "MonoLisa",
  "buffer_font_size": 14,
  "terminal": {
    "font_size": 13
  },
  "base_keymap": "VSCode",
  "git": {
    "inline_blame": {
      "enabled": false
    },
    "git_gutter": "hide"
  },
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "check": {
          "command": "clippy"
        }
      }
    }
  }
}

Environment

Zed: v0.147.2 (Zed) OS: macOS 14.4.1 Memory: 16 GiB Architecture: aarch64

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

Details
Zed.log

Since the log had too many characters, I've created a Gist here: https://gist.github.com/tinfoil-knight/ca51a63fb126457da788ccdad3c1f6a5#file-zed-crash-log If it helps, I've also added the log that Mac records separately on crash and added it in the gist above.
notpeter commented 1 month ago

Excellent reproduction steps! This reliably crashes on Zed Stable (0.147.2) and on Zed Nightly (0.149.x) on MacOS. It does not crash the minibuffer, only when hovered in the main editor:

Screenshot 2024-08-12 at 11 45 44
panic
byte index 444 is out of bounds of `rustc: mismatched types
expected struct `Vec>`
   found struct `Vec`
for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by`[...]
::create
::new
zed::reliability::init_panic_hook::{closure#0}
std::panicking::rust_panic_with_hook
std::panicking::begin_panic_handler::{{closure}}
std::sys_common::backtrace::__rust_end_short_backtrace
_rust_begin_unwind
core::panicking::panic_fmt
core::str::slice_error_fail_rt
core::str::slice_error_fail
::request_layout
>::request_layout
>>::request_layout
::request_layout::{closure#0}::{closure#0}
::request_layout::<::request_layout::{closure#0}>::{closure#0}
::request_layout
>>::request_layout
::request_layout::{closure#0}::{closure#0}
::request_layout::<::request_layout::{closure#0}>::{closure#0}
::request_layout
   and 90 more
uladkaminski commented 1 month ago

Added PR for that issue. Let me know if any comments.

image

https://github.com/zed-industries/zed/pull/16132