1
1
//@ edition: 2024
2
- //@ revisions: classic structural
2
+ //@ revisions: classic2024 structural2024
3
3
//! Tests for pattern errors not handled by the pattern typing rules, but by borrowck.
4
4
#![ 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) ) ]
7
7
8
8
pub fn main ( ) {
9
9
if let Some ( & Some ( x) ) = Some ( & Some ( & mut 0 ) ) {
@@ -15,23 +15,23 @@ pub fn main() {
15
15
//~^ cannot borrow data in a `&` reference as mutable [E0596]
16
16
17
17
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
19
19
let _: & u32 = x;
20
20
}
21
21
22
22
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
24
24
let _: & u32 = x;
25
25
26
26
let [ & x] = & [ & mut 0 ] ;
27
- //[classic ]~^ ERROR: cannot move out of type
27
+ //[classic2024 ]~^ ERROR: cannot move out of type
28
28
let _: & u32 = x;
29
29
30
30
let [ & x] = & mut [ & mut 0 ] ;
31
- //[classic ]~^ ERROR: cannot move out of type
31
+ //[classic2024 ]~^ ERROR: cannot move out of type
32
32
let _: & u32 = x;
33
33
34
34
let [ & mut x] = & mut [ & mut 0 ] ;
35
- //[classic ]~^ ERROR: cannot move out of type
35
+ //[classic2024 ]~^ ERROR: cannot move out of type
36
36
let _: & mut u32 = x;
37
37
}
0 commit comments