rust/tests/ui/box/suggest-box-for-expr-field-issue-139631.rs
xizheyin dca57c6714
Add ui test suggest-box-for-expr-field-issue-139631
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-14 15:08:17 +08:00

15 lines
282 B
Rust

struct X {
a: Box<u32>,
}
struct Y {
y: Box<u32>,
}
fn main() {
let a = 8;
let v2 = X { a }; //~ ERROR mismatched types [E0308]
let v3 = Y { y: a }; //~ ERROR mismatched types [E0308]
let v4 = Y { a }; //~ ERROR struct `Y` has no field named `a` [E0560]
}