rust/tests/ui/traits/new-solver/structural-resolve-field.rs
2023-06-02 22:07:57 +00:00

14 lines
195 B
Rust

// compile-flags: -Ztrait-solver=next
// check-pass
#[derive(Default)]
struct Foo {
x: i32,
}
fn main() {
let mut xs = <[Foo; 1]>::default();
xs[0].x = 1;
(&mut xs[0]).x = 2;
}