Skip to content

Commit d984f12

Browse files
committed
move_ref_patterns: introduce tests
bindings_after_at: harden tests
1 parent 7af9ff3 commit d984f12

File tree

50 files changed

+1919
-541
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1919
-541
lines changed

src/test/ui/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-2.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/test/ui/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-2.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/test/ui/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-3.rs

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/test/ui/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-3.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/test/ui/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-4.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/test/ui/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-4.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/test/ui/drop/dynamic-drop-async.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
// edition:2018
88
// ignore-wasm32-bare compiled with panic=abort by default
99

10+
#![feature(move_ref_pattern)]
11+
1012
#![allow(unused)]
1113

1214
use std::{
@@ -227,6 +229,12 @@ async fn subslice_pattern_reassign(a: Rc<Allocator>) {
227229
a.alloc().await;
228230
}
229231

232+
async fn move_ref_pattern(a: Rc<Allocator>) {
233+
let mut tup = (a.alloc().await, a.alloc().await, a.alloc().await, a.alloc().await);
234+
let (ref _a, ref mut _b, _c, mut _d) = tup;
235+
a.alloc().await;
236+
}
237+
230238
fn run_test<F, G>(cx: &mut Context<'_>, ref f: F)
231239
where
232240
F: Fn(Rc<Allocator>) -> G,
@@ -322,4 +330,6 @@ fn main() {
322330
run_test(context, |a| subslice_pattern_from_end_with_drop(a, false, true));
323331
run_test(context, |a| subslice_pattern_from_end_with_drop(a, false, false));
324332
run_test(context, |a| subslice_pattern_reassign(a));
333+
334+
run_test(context, |a| move_ref_pattern(a));
325335
}

src/test/ui/drop/dynamic-drop.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// ignore-wasm32-bare compiled with panic=abort by default
33

44
#![feature(generators, generator_trait, untagged_unions)]
5+
#![feature(move_ref_pattern)]
56

67
#![allow(unused_assignments)]
78
#![allow(unused_variables)]
@@ -290,6 +291,11 @@ fn subslice_mixed_min_lengths(a: &Allocator, c: i32) {
290291
}
291292
}
292293

294+
fn move_ref_pattern(a: &Allocator) {
295+
let mut tup = (a.alloc(), a.alloc(), a.alloc(), a.alloc());
296+
let (ref _a, ref mut _b, _c, mut _d) = tup;
297+
}
298+
293299
fn panic_after_return(a: &Allocator) -> Ptr<'_> {
294300
// Panic in the drop of `p` or `q` can leak
295301
let exceptions = vec![8, 9];
@@ -453,6 +459,8 @@ fn main() {
453459
run_test(|a| subslice_mixed_min_lengths(a, 6));
454460
run_test(|a| subslice_mixed_min_lengths(a, 7));
455461

462+
run_test(|a| move_ref_pattern(a));
463+
456464
run_test(|a| {
457465
panic_after_return(a);
458466
});

src/test/ui/error-codes/E0009.rs

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/test/ui/error-codes/E0009.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)