Add a test for an LLVM crash "Vector elements must have same size"

This commit is contained in:
Jacob Adam
2026-04-09 09:35:54 +01:00
parent 1fe72d3599
commit f493cab3e3
@@ -0,0 +1,17 @@
//! Regression test for https://github.com/rust-lang/rust/issues/104037.
//! LLVM used to hit an assertion "Vector elements must have same size"
//! when compiling derived Clone with MIR optimisation level of 3.
//@ build-pass
//@ compile-flags: -Zmir-opt-level=3 -Copt-level=3
#[derive(Clone)]
pub struct Foo(Bar, u32);
#[derive(Clone, Copy)]
pub struct Bar(u8, u8, u8);
fn main() {
let foo: Vec<Foo> = Vec::new();
let _ = foo.clone();
}