rust/tests/ui/traits/new-solver/structural-resolve-field.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
195 B
Rust
Raw Normal View History

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