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

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

14 lines
189 B
Rust
Raw Normal View History

2023-12-14 06:11:28 -06:00
// compile-flags: -Znext-solver
// 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;
}