22//@ run-rustfix
33//@ rustfix-only-machine-applicable
44//@ aux-build:migration_lint_macros.rs
5- #![feature(mut_ref, min_match_ergonomics_2024 )]
5+ #![feature(mut_ref)]
66#![allow(incomplete_features, unused)]
77#![deny(rust_2024_incompatible_pat)]
88
@@ -24,18 +24,22 @@ fn main() {
2424
2525 let &Foo(mut x) = &Foo(0);
2626 //~^ ERROR: the semantics of this pattern will change in edition 2024
27+ //~| WARN: this changes meaning in Rust 2024
2728 assert_type_eq(x, 0u8);
2829
2930 let &mut Foo(mut x) = &mut Foo(0);
3031 //~^ ERROR: the semantics of this pattern will change in edition 2024
32+ //~| WARN: this changes meaning in Rust 2024
3133 assert_type_eq(x, 0u8);
3234
3335 let &Foo(ref x) = &Foo(0);
3436 //~^ ERROR: the semantics of this pattern will change in edition 2024
37+ //~| WARN: this changes meaning in Rust 2024
3538 assert_type_eq(x, &0u8);
3639
3740 let &mut Foo(ref x) = &mut Foo(0);
3841 //~^ ERROR: the semantics of this pattern will change in edition 2024
42+ //~| WARN: this changes meaning in Rust 2024
3943 assert_type_eq(x, &0u8);
4044
4145 let &Foo(x) = &Foo(0);
@@ -52,18 +56,22 @@ fn main() {
5256
5357 let &Foo(&x) = &Foo(&0);
5458 //~^ ERROR: the semantics of this pattern will change in edition 2024
59+ //~| WARN: this changes meaning in Rust 2024
5560 assert_type_eq(x, 0u8);
5661
5762 let &Foo(&mut x) = &Foo(&mut 0);
5863 //~^ ERROR: the semantics of this pattern will change in edition 2024
64+ //~| WARN: this changes meaning in Rust 2024
5965 assert_type_eq(x, 0u8);
6066
6167 let &mut Foo(&x) = &mut Foo(&0);
6268 //~^ ERROR: the semantics of this pattern will change in edition 2024
69+ //~| WARN: this changes meaning in Rust 2024
6370 assert_type_eq(x, 0u8);
6471
6572 let &mut Foo(&mut x) = &mut Foo(&mut 0);
6673 //~^ ERROR: the semantics of this pattern will change in edition 2024
74+ //~| WARN: this changes meaning in Rust 2024
6775 assert_type_eq(x, 0u8);
6876
6977 if let Some(x) = &&&&&Some(&0u8) {
@@ -72,21 +80,25 @@ fn main() {
7280
7381 if let &&&&&Some(&x) = &&&&&Some(&0u8) {
7482 //~^ ERROR: the semantics of this pattern will change in edition 2024
83+ //~| WARN: this changes meaning in Rust 2024
7584 assert_type_eq(x, 0u8);
7685 }
7786
7887 if let &&&&&Some(&mut x) = &&&&&Some(&mut 0u8) {
7988 //~^ ERROR: the semantics of this pattern will change in edition 2024
89+ //~| WARN: this changes meaning in Rust 2024
8090 assert_type_eq(x, 0u8);
8191 }
8292
8393 if let &&&&&mut Some(&x) = &&&&&mut Some(&0u8) {
8494 //~^ ERROR: the semantics of this pattern will change in edition 2024
95+ //~| WARN: this changes meaning in Rust 2024
8596 assert_type_eq(x, 0u8);
8697 }
8798
8899 if let &mut Some(&mut Some(&mut Some(ref mut x))) = &mut Some(&mut Some(&mut Some(0u8))) {
89100 //~^ ERROR: the semantics of this pattern will change in edition 2024
101+ //~| WARN: this changes meaning in Rust 2024
90102 assert_type_eq(x, &mut 0u8);
91103 }
92104
@@ -98,17 +110,20 @@ fn main() {
98110
99111 let &Struct { ref a, mut b, ref c } = &Struct { a: 0, b: 0, c: 0 };
100112 //~^ ERROR: the semantics of this pattern will change in edition 2024
113+ //~| WARN: this changes meaning in Rust 2024
101114 assert_type_eq(a, &0u32);
102115 assert_type_eq(b, 0u32);
103116
104117 let &Struct { a: &a, ref b, ref c } = &Struct { a: &0, b: &0, c: &0 };
105118 //~^ ERROR: the semantics of this pattern will change in edition 2024
119+ //~| WARN: this changes meaning in Rust 2024
106120 assert_type_eq(a, 0u32);
107121 assert_type_eq(b, &&0u32);
108122 assert_type_eq(c, &&0u32);
109123
110124 if let &Struct { a: &Some(a), b: &Some(&b), c: &Some(ref c) } =
111125 //~^ ERROR: the semantics of this pattern will change in edition 2024
126+ //~| WARN: this changes meaning in Rust 2024
112127 &(Struct { a: &Some(&0), b: &Some(&0), c: &Some(&0) })
113128 {
114129 assert_type_eq(a, &0u32);
0 commit comments