2024-04-05 22:27:29 -05:00
|
|
|
//@ run-pass
|
|
|
|
//@ edition: 2024
|
|
|
|
//@ compile-flags: -Zunstable-options
|
2024-05-15 15:55:54 -05:00
|
|
|
#![feature(mut_ref, ref_pat_eat_one_layer_2024)]
|
2024-04-14 12:33:11 -05:00
|
|
|
#![allow(incomplete_features, unused)]
|
2024-04-05 22:27:29 -05:00
|
|
|
|
|
|
|
struct Foo(u8);
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let Foo(mut a) = &Foo(0);
|
|
|
|
a = &42;
|
|
|
|
|
|
|
|
let Foo(mut a) = &mut Foo(0);
|
|
|
|
a = &mut 42;
|
|
|
|
}
|