11//@ edition: 2024
2- //@ revisions: classic structural
2+ //@ revisions: classic2024 structural2024
33//! Tests for pattern errors not handled by the pattern typing rules, but by borrowck.
44#![ allow( incomplete_features) ]
5- #![ cfg_attr( classic , feature( ref_pat_eat_one_layer_2024) ) ]
6- #![ cfg_attr( structural , feature( ref_pat_eat_one_layer_2024_structural) ) ]
5+ #![ cfg_attr( classic2024 , feature( ref_pat_eat_one_layer_2024) ) ]
6+ #![ cfg_attr( structural2024 , feature( ref_pat_eat_one_layer_2024_structural) ) ]
77
88pub fn main ( ) {
99 if let Some ( & Some ( x) ) = Some ( & Some ( & mut 0 ) ) {
@@ -15,23 +15,23 @@ pub fn main() {
1515 //~^ cannot borrow data in a `&` reference as mutable [E0596]
1616
1717 if let & Some ( Some ( x) ) = & Some ( & mut Some ( 0 ) ) {
18- //[classic ]~^ ERROR: cannot borrow data in a `&` reference as mutable
18+ //[classic2024 ]~^ ERROR: cannot borrow data in a `&` reference as mutable
1919 let _: & u32 = x;
2020 }
2121
2222 let & [ x] = & & mut [ 0 ] ;
23- //[classic ]~^ ERROR: cannot borrow data in a `&` reference as mutable
23+ //[classic2024 ]~^ ERROR: cannot borrow data in a `&` reference as mutable
2424 let _: & u32 = x;
2525
2626 let [ & x] = & [ & mut 0 ] ;
27- //[classic ]~^ ERROR: cannot move out of type
27+ //[classic2024 ]~^ ERROR: cannot move out of type
2828 let _: & u32 = x;
2929
3030 let [ & x] = & mut [ & mut 0 ] ;
31- //[classic ]~^ ERROR: cannot move out of type
31+ //[classic2024 ]~^ ERROR: cannot move out of type
3232 let _: & u32 = x;
3333
3434 let [ & mut x] = & mut [ & mut 0 ] ;
35- //[classic ]~^ ERROR: cannot move out of type
35+ //[classic2024 ]~^ ERROR: cannot move out of type
3636 let _: & mut u32 = x;
3737}
0 commit comments