1 // Due to #53114, which causes a "read" of the `_` patterns,
2 // the borrow-checker refuses this code, while it should probably be allowed.
3 // Once the bug is fixed, the test, which is derived from a
4 // passing test for `let` statements, should become check-pass.
6 #![feature(slice_patterns)]
8 fn array() -> [(String, String); 3] {
12 // Const Index + Const Index
14 fn move_out_from_begin_and_one_from_end() {
20 //~^ ERROR use of moved value
25 fn move_out_from_begin_field_and_end_field() {
31 //~^ ERROR use of moved value
36 // Const Index + Slice
38 fn move_out_by_const_index_and_subslice() {
44 //~^ ERROR use of moved value
49 fn move_out_by_const_index_end_and_subslice() {
55 //~^ ERROR use of moved value
60 fn move_out_by_const_index_field_and_subslice() {
66 //~^ ERROR use of moved value
71 fn move_out_by_const_index_end_field_and_subslice() {
77 //~^ ERROR use of moved value
82 fn move_out_by_const_subslice_and_index_field() {
88 //~^ ERROR use of moved value
93 fn move_out_by_const_subslice_and_end_index_field() {
99 //~^ ERROR use of moved value
106 fn move_out_by_subslice_and_subslice() {
112 //~^ ERROR use of moved value