-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
Description
rust-analyzer version: rust-analyzer version: 1.96.0-nightly (3102493c 2026-03-12) [/Users/niklas/.rustup/toolchains/nightly-2026-03-13-aarch64-apple-darwin/bin/rust-analyzer]
rustc version: nightly-2026-03-13
editor or extension: vscode with 0.3.2819
relevant settings:
[toolchain]
channel = "nightly-2026-03-13"
components = ["rustfmt", "clippy", "rust-analyzer"]
profile = "minimal"
repository link: https://github.com/mischnic/rust-analyzer-generic-size-nightly
code snippet to reproduce:
use std::num::NonZero;
pub struct Test<K, T = u8> {
pub k: K,
pub t: T,
}
// "needs Drop"
pub struct X {
pub a: Vec<u32>, // "needs Drop"
pub b: NonZero<i32>, // "no Drop"
pub c: u32, // "size = 4, align = 0x4, no Drop"
pub d: Test<i32>, // "size = 8, align = 0x4, no Drop"
}
fn main() {
// "size = 8, align = 0x4, no Drop"
let _x = Test { k: 42, t: 255 };
// "no Drop"
let _y = std::num::NonZero::new(1i32).unwrap();
println!("Hello, world!");
}When using a recent nightly version, the hover menu doesn't compute the size/alignment/layout information for generic types from the standard library. Locally-declared generic types work fine though.
With channel = "1.94.0", all these types are correctly computed.
1.95.0-beta.3 is broken as well
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackNo fields configured for issues without a type.