Skip to content

Commit be16344

Browse files
bless some tests
Signed-off-by: Xiangfei Ding <[email protected]>
1 parent 777c34b commit be16344

7 files changed

+19
-25
lines changed

tests/codegen-llvm/async-fn-debug.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async fn async_fn_test() {
3838
// CHECK-NOT: flags: DIFlagArtificial
3939
// CHECK-SAME: )
4040
// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "3", scope: [[VARIANT]],
41-
// CHECK-SAME: file: [[FILE]], line: 14,
41+
// CHECK-SAME: file: [[FILE]], line: 15,
4242
// CHECK-NOT: flags: DIFlagArtificial
4343
// CHECK-SAME: )
4444
// CHECK: [[S0:!.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Suspend0", scope: [[GEN]],
@@ -48,7 +48,7 @@ async fn async_fn_test() {
4848
// CHECK-NOT: flags: DIFlagArtificial
4949
// CHECK-SAME: )
5050
// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "4", scope: [[VARIANT]],
51-
// CHECK-SAME: file: [[FILE]], line: 12,
51+
// CHECK-SAME: file: [[FILE]], line: 13,
5252
// CHECK-NOT: flags: DIFlagArtificial
5353
// CHECK-SAME: )
5454
// CHECK: [[DISC]] = !DIDerivedType(tag: DW_TAG_member, name: "__state", scope: [[GEN]],

tests/mir-opt/coroutine_relocate_upvars.main-{closure#0}.RelocateUpvars.after.panic-abort.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// MIR for `main::{closure#0}` after RelocateUpvars
22

3-
fn main::{closure#0}(_1: {coroutine@$DIR/coroutine-relocate-upvars.rs:12:5: 12:7}, _2: ()) -> ()
3+
fn main::{closure#0}(_1: {coroutine@$DIR/coroutine_relocate_upvars.rs:12:5: 12:7}, _2: ()) -> ()
44
yields ()
55
{
66
debug x => (*_6);

tests/mir-opt/coroutine_relocate_upvars.main-{closure#0}.RelocateUpvars.after.panic-unwind.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// MIR for `main::{closure#0}` after RelocateUpvars
22

3-
fn main::{closure#0}(_1: {coroutine@$DIR/coroutine-relocate-upvars.rs:12:5: 12:7}, _2: ()) -> ()
3+
fn main::{closure#0}(_1: {coroutine@$DIR/coroutine_relocate_upvars.rs:12:5: 12:7}, _2: ()) -> ()
44
yields ()
55
{
66
debug x => (*_6);

tests/mir-opt/coroutine_relocate_upvars.main-{closure#0}.RelocateUpvars.before.panic-abort.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// MIR for `main::{closure#0}` before RelocateUpvars
22

3-
fn main::{closure#0}(_1: {coroutine@$DIR/coroutine-relocate-upvars.rs:12:5: 12:7}, _2: ()) -> ()
3+
fn main::{closure#0}(_1: {coroutine@$DIR/coroutine_relocate_upvars.rs:12:5: 12:7}, _2: ()) -> ()
44
yields ()
55
{
66
debug x => (*(_1.0: &mut std::string::String));

tests/mir-opt/coroutine_relocate_upvars.main-{closure#0}.RelocateUpvars.before.panic-unwind.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// MIR for `main::{closure#0}` before RelocateUpvars
22

3-
fn main::{closure#0}(_1: {coroutine@$DIR/coroutine-relocate-upvars.rs:12:5: 12:7}, _2: ()) -> ()
3+
fn main::{closure#0}(_1: {coroutine@$DIR/coroutine_relocate_upvars.rs:12:5: 12:7}, _2: ()) -> ()
44
yields ()
55
{
66
debug x => (*(_1.0: &mut std::string::String));

tests/mir-opt/coroutine-relocate-upvars.rs renamed to tests/mir-opt/coroutine_relocate_upvars.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ fn main() {
1313
x = String::new();
1414
yield;
1515
};
16-
}
16+
}

tests/ui/async-await/async-drop/async-drop-initial.rs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use core::future::{AsyncDrop, Future, async_drop_in_place};
1818
use core::hint::black_box;
1919
use core::mem::{self, ManuallyDrop};
2020
use core::pin::{Pin, pin};
21-
use core::task::{Context, Poll, Waker};
2221
use core::sync::atomic::{AtomicBool, Ordering};
22+
use core::task::{Context, Poll, Waker};
2323

2424
static PASS: AtomicBool = AtomicBool::new(false);
2525

@@ -33,7 +33,10 @@ async fn test_async_drop<T>(x: T, #[allow(unused)] expect: usize) {
3333
let got = mem::size_of_val(&*dtor);
3434
#[cfg(target_pointer_width = "64")]
3535
if expect != got {
36-
println!("sizes did not match for async destructor of type {}, expect {expect}, got {got}", core::any::type_name::<T>());
36+
println!(
37+
"sizes did not match for async destructor of type {}, expect {expect}, got {got}",
38+
core::any::type_name::<T>()
39+
);
3740
PASS.store(false, Ordering::Relaxed);
3841
}
3942

@@ -68,12 +71,9 @@ fn main() {
6871
test_async_drop(&j, [16, 24][cfg!(classic) as usize]).await;
6972
test_async_drop(
7073
AsyncStruct { b: AsyncInt(8), a: AsyncInt(7), i: 6 },
71-
if cfg!(panic = "unwind") {
72-
[128, 192][cfg!(classic) as usize]
73-
} else {
74-
136
75-
},
76-
).await;
74+
if cfg!(panic = "unwind") { [128, 192][cfg!(classic) as usize] } else { 136 },
75+
)
76+
.await;
7777
test_async_drop(ManuallyDrop::new(AsyncInt(9)), [16, 24][cfg!(classic) as usize]).await;
7878

7979
let foo = AsyncInt(10);
@@ -240,19 +240,13 @@ union AsyncUnion {
240240

241241
impl Drop for AsyncUnion {
242242
fn drop(&mut self) {
243-
println!(
244-
"AsyncUnion::drop: {}, {}",
245-
unsafe { self.signed },
246-
unsafe { self.unsigned },
247-
);
243+
println!("AsyncUnion::drop: {}, {}", unsafe { self.signed }, unsafe { self.unsigned },);
248244
}
249245
}
250246
impl AsyncDrop for AsyncUnion {
251247
async fn drop(self: Pin<&mut Self>) {
252-
println!(
253-
"AsyncUnion::Dropper::poll: {}, {}",
254-
unsafe { self.signed },
255-
unsafe { self.unsigned },
256-
);
248+
println!("AsyncUnion::Dropper::poll: {}, {}", unsafe { self.signed }, unsafe {
249+
self.unsigned
250+
},);
257251
}
258252
}

0 commit comments

Comments
 (0)