You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rust-analyzer version: rust-analyzer 1.83.0 via rust-analyzer-1.83.0-1.fc41.x86_64 rustc version: rustc 1.83.0 (90b35a623 2024-11-26) (Fedora 1.83.0-1.fc41) via rust-1.83.0-1.fc41.x86_64 editor or extension: nvim from Fedora 41: neovim-0.10.2-1.fc41.x86_64 relevant settings:
LSP configs active in this buffer (bufnr: 1) ~
- Language client log: ~/.local/state/nvim/lsp.log
- Detected filetype: `rust`
- 1 client(s) attached to this buffer
- Client: `rust_analyzer` (id: 1, bufnr: [1])
root directory: ~/src/reproducer/
filetypes: rust
cmd: /usr/local/bin/rust-analyzer
version: `rust-analyzer 1.85.0-nightly (d4025ee 2024-12-12)`
executable: true
autostart: true
code snippet to reproduce:
// add your code hereuse zerocopy::KnownLayout;#[derive(KnownLayout)]#[repr(C)]structFlexible{header:u32,body:[u8],}
This gets you
1. casting `*mut _` as `*mut __ZerocopyKnownLayoutMaybeUninit` is invalid: vtable kinds may not match [E0606]
2. casting `*mut __ZerocopyKnownLayoutMaybeUninit` as `*mut _` is invalid: vtable kinds may not match [E0606]
but with cargo build it's fine.
This is caused by Flexible being a DST (dynamically sized type). Dropping the variable-sized body: [u8] field makes the problem go away.
I also tried with nightly (rust-analyzer 1.85.0-nightly (d4025ee 2024-12-12)) without improvement.
The text was updated successfully, but these errors were encountered:
rust-analyzer version:
rust-analyzer 1.83.0
viarust-analyzer-1.83.0-1.fc41.x86_64
rustc version:
rustc 1.83.0 (90b35a623 2024-11-26) (Fedora 1.83.0-1.fc41)
viarust-1.83.0-1.fc41.x86_64
editor or extension: nvim from Fedora 41:
neovim-0.10.2-1.fc41.x86_64
relevant settings:
code snippet to reproduce:
This gets you
but with
cargo build
it's fine.This is caused by Flexible being a DST (dynamically sized type). Dropping the variable-sized
body: [u8]
field makes the problem go away.I also tried with nightly (
rust-analyzer 1.85.0-nightly (d4025ee 2024-12-12)
) without improvement.The text was updated successfully, but these errors were encountered: