rust/tests/ui/pattern/mut_preserve_binding_mode_2024.rs

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

16 lines
284 B
Rust
Raw Normal View History

//@ run-pass
//@ edition: 2024
//@ compile-flags: -Zunstable-options
#![feature(mut_ref, ref_pat_eat_one_layer_2024)]
2024-04-14 12:33:11 -05:00
#![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;
}