mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 20:23:59 +00:00
16 lines
284 B
Rust
16 lines
284 B
Rust
//@ run-pass
|
|
//@ edition: 2024
|
|
//@ compile-flags: -Zunstable-options
|
|
#![feature(mut_ref, ref_pat_eat_one_layer_2024)]
|
|
#![allow(incomplete_features, unused)]
|
|
|
|
struct Foo(u8);
|
|
|
|
fn main() {
|
|
let Foo(mut a) = &Foo(0);
|
|
a = &42;
|
|
|
|
let Foo(mut a) = &mut Foo(0);
|
|
a = &mut 42;
|
|
}
|