Skip to content

Commit 0ceb235

Browse files
bless some tests
Signed-off-by: Xiangfei Ding <dingxiangfei2009@protonmail.ch>
1 parent b15c011 commit 0ceb235

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

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

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

8080
let foo = AsyncInt(10);
@@ -241,19 +241,13 @@ union AsyncUnion {
241241

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

0 commit comments

Comments
 (0)