about summary refs log tree commit diff
path: root/tests/ui/pattern/mut_preserve_binding_mode_2024.rs
blob: a4afcb2e5111c579589f86f215c1131c87ec8132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//@ run-pass
//@ edition: 2024
#![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;
}