mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
15 lines
279 B
Rust
15 lines
279 B
Rust
//@ run-pass
|
|
//@ edition: 2024
|
|
//@ compile-flags: -Zunstable-options
|
|
#![feature(mut_preserve_binding_mode_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;
|
|
}
|