Files
rust/tests/ui/pattern/struct-mismatch-destructure-14541.rs

14 lines
318 B
Rust
Raw Normal View History

2025-07-24 17:52:22 +05:00
//! Regression test for https://github.com/rust-lang/rust/issues/14541
struct Vec2 { y: f32 }
struct Vec3 { y: f32, z: f32 }
fn make(v: Vec2) {
let Vec3 { y: _, z: _ } = v;
2015-01-12 01:01:44 -05:00
//~^ ERROR mismatched types
//~| NOTE expected `Vec2`, found `Vec3`
//~| NOTE this expression has type `Vec2`
}
fn main() { }