about summary refs log tree commit diff
path: root/tests/ui/pattern/struct-mismatch-destructure-14541.rs
blob: 358d29419f95b51985cf23a34ac190273fdad0d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
struct Vec2 { y: f32 }
struct Vec3 { y: f32, z: f32 }

fn make(v: Vec2) {
    let Vec3 { y: _, z: _ } = v;
    //~^ ERROR mismatched types
    //~| NOTE expected `Vec2`, found `Vec3`
    //~| NOTE this expression has type `Vec2`
}

fn main() { }