mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 11:34:11 +00:00
14 lines
189 B
Rust
14 lines
189 B
Rust
// compile-flags: -Znext-solver
|
|
// 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;
|
|
}
|