rust/tests/ui/pattern/mut_preserve_binding_mode_2021.rs
Jules Bertholet 7a3211726b
Fix tests
2024-04-15 23:27:22 -04:00

17 lines
324 B
Rust

//@ edition: 2021
//@ compile-flags: -Zunstable-options
#![feature(mut_preserve_binding_mode_2024)]
#![allow(incomplete_features)]
struct Foo(u8);
fn main() {
let Foo(mut a) = &Foo(0);
a = &42;
//~^ ERROR: mismatched types
let Foo(mut a) = &mut Foo(0);
a = &mut 42;
//~^ ERROR: mismatched types
}