Skip to content

Commit 43f7a18

Browse files
committed
Update tests.
1 parent 91c3a8d commit 43f7a18

11 files changed

+27
-27
lines changed

tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
- _4 = g() -> [return: bb1, unwind unreachable];
3434
+ _4 = {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8 (#0)};
3535
+ _3 = &mut _4;
36-
+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}> { __pointer: copy _3 };
36+
+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}> { pointer: copy _3 };
3737
+ StorageDead(_3);
3838
+ StorageLive(_5);
3939
+ _5 = const false;

tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
- _4 = g() -> [return: bb1, unwind continue];
3434
+ _4 = {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8 (#0)};
3535
+ _3 = &mut _4;
36-
+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}> { __pointer: copy _3 };
36+
+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}> { pointer: copy _3 };
3737
+ StorageDead(_3);
3838
+ StorageLive(_5);
3939
+ _5 = const false;

tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
- }
122122
-
123123
- bb2: {
124-
+ _4 = Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}> { __pointer: copy _5 };
124+
+ _4 = Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}> { pointer: copy _5 };
125125
StorageDead(_5);
126126
StorageLive(_6);
127127
StorageLive(_7);
@@ -218,7 +218,7 @@
218218
+ _37 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
219219
+ _21 = &mut (((*_37) as variant#3).1: std::future::Ready<()>);
220220
+ _20 = &mut (*_21);
221-
+ _19 = Pin::<&mut std::future::Ready<()>> { __pointer: copy _20 };
221+
+ _19 = Pin::<&mut std::future::Ready<()>> { pointer: copy _20 };
222222
+ StorageDead(_20);
223223
+ StorageLive(_22);
224224
+ StorageLive(_23);
@@ -240,7 +240,7 @@
240240
+ _48 = &mut (_19.0: &mut std::future::Ready<()>);
241241
+ _45 = copy (_19.0: &mut std::future::Ready<()>);
242242
+ StorageDead(_48);
243-
+ _47 = Pin::<&mut std::future::Ready<()>> { __pointer: copy _45 };
243+
+ _47 = Pin::<&mut std::future::Ready<()>> { pointer: copy _45 };
244244
+ StorageDead(_47);
245245
+ _44 = &mut ((*_45).0: std::option::Option<()>);
246246
+ _49 = Option::<()>::None;

tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
- }
124124
-
125125
- bb2: {
126-
+ _4 = Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}> { __pointer: copy _5 };
126+
+ _4 = Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}> { pointer: copy _5 };
127127
StorageDead(_5);
128128
StorageLive(_6);
129129
StorageLive(_7);
@@ -235,7 +235,7 @@
235235
+ _37 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
236236
+ _21 = &mut (((*_37) as variant#3).1: std::future::Ready<()>);
237237
+ _20 = &mut (*_21);
238-
+ _19 = Pin::<&mut std::future::Ready<()>> { __pointer: copy _20 };
238+
+ _19 = Pin::<&mut std::future::Ready<()>> { pointer: copy _20 };
239239
+ StorageDead(_20);
240240
+ StorageLive(_22);
241241
+ StorageLive(_23);
@@ -257,7 +257,7 @@
257257
+ _50 = &mut (_19.0: &mut std::future::Ready<()>);
258258
+ _47 = copy (_19.0: &mut std::future::Ready<()>);
259259
+ StorageDead(_50);
260-
+ _49 = Pin::<&mut std::future::Ready<()>> { __pointer: copy _47 };
260+
+ _49 = Pin::<&mut std::future::Ready<()>> { pointer: copy _47 };
261261
+ StorageDead(_49);
262262
+ _46 = &mut ((*_47).0: std::option::Option<()>);
263263
+ _51 = Option::<()>::None;

tests/pretty/postfix-yield.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
//@ edition: 2024
33
//@ pp-exact
44

5-
#![feature(gen_blocks, coroutines, coroutine_trait, yield_expr)]
5+
#![feature(gen_blocks, coroutines, coroutine_trait, yield_expr,
6+
stmt_expr_attributes)]
67

78
use std::ops::{Coroutine, CoroutineState};
89
use std::pin::pin;

tests/ui/async-await/pin-ergonomics/reborrow-once.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0499]: cannot borrow `*x.__pointer` as mutable more than once at a time
1+
error[E0499]: cannot borrow `*x.pointer` as mutable more than once at a time
22
--> $DIR/reborrow-once.rs:12:14
33
|
44
LL | twice(x, x);

tests/ui/coroutine/postfix-yield.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@ run-pass
44
//@ edition: 2024
55

6-
#![feature(gen_blocks, coroutines, coroutine_trait, yield_expr)]
6+
#![feature(gen_blocks, coroutines, coroutine_trait, yield_expr, stmt_expr_attributes)]
77

88
use std::ops::{Coroutine, CoroutineState};
99
use std::pin::pin;

tests/ui/pin-macro/lifetime_errors_on_promotion_misusage.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ use core::{
99

1010
fn function_call_stops_borrow_extension() {
1111
let phantom_pinned = identity(pin!(PhantomPinned));
12-
//~^ ERROR temporary value dropped while borrowed
12+
//~^ ERROR does not live long enough
1313
stuff(phantom_pinned)
1414
}
1515

1616
fn promotion_only_works_for_the_innermost_block() {
1717
let phantom_pinned = {
1818
let phantom_pinned = pin!(PhantomPinned);
19-
//~^ ERROR temporary value dropped while borrowed
19+
//~^ ERROR does not live long enough
2020
phantom_pinned
2121
};
2222
stuff(phantom_pinned)
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,29 @@
1-
error[E0716]: temporary value dropped while borrowed
1+
error[E0597]: value does not live long enough
22
--> $DIR/lifetime_errors_on_promotion_misusage.rs:11:35
33
|
44
LL | let phantom_pinned = identity(pin!(PhantomPinned));
5-
| ^^^^^^^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
5+
| ^^^^^^^^^^^^^^^^^^^ - value dropped here while still borrowed
66
| |
7-
| creates a temporary value which is freed while still in use
7+
| borrowed value does not live long enough
88
LL |
99
LL | stuff(phantom_pinned)
1010
| -------------- borrow later used here
1111
|
1212
= note: this error originates in the macro `pin` (in Nightly builds, run with -Z macro-backtrace for more info)
13-
help: consider using a `let` binding to create a longer lived value
14-
|
15-
LL ~ let binding = pin!(PhantomPinned);
16-
LL ~ let phantom_pinned = identity(binding);
17-
|
1813

19-
error[E0716]: temporary value dropped while borrowed
14+
error[E0597]: value does not live long enough
2015
--> $DIR/lifetime_errors_on_promotion_misusage.rs:18:30
2116
|
2217
LL | let phantom_pinned = {
2318
| -------------- borrow later stored here
2419
LL | let phantom_pinned = pin!(PhantomPinned);
25-
| ^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
20+
| ^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
2621
...
2722
LL | };
28-
| - temporary value is freed at the end of this statement
23+
| - value dropped here while still borrowed
2924
|
30-
= note: consider using a `let` binding to create a longer lived value
3125
= note: this error originates in the macro `pin` (in Nightly builds, run with -Z macro-backtrace for more info)
3226

3327
error: aborting due to 2 previous errors
3428

35-
For more information about this error, try `rustc --explain E0716`.
29+
For more information about this error, try `rustc --explain E0597`.

tests/ui/pin-macro/pin_move.stderr

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ LL | struct NotCopy<T>(T);
3131
LL | let mut pointee = NotCopy(PhantomPinned);
3232
LL | pin!(*&mut pointee);
3333
| ------------- you could clone this value
34+
help: consider removing the dereference here
35+
|
36+
LL - pin!(*&mut pointee);
37+
LL + pin!(&mut pointee);
38+
|
3439

3540
error: aborting due to 2 previous errors
3641

tests/ui/sanitizer/cfi/coroutine.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use std::async_iter::AsyncIterator;
2626

2727
#[test]
2828
fn general_coroutine() {
29-
let mut coro = #[coroutine] |x: i32| {
29+
let coro = #[coroutine] |x: i32| {
3030
yield x;
3131
"done"
3232
};

0 commit comments

Comments
 (0)