Regression in issue 99684 fixed
This commit is contained in:
parent
f1ca69d245
commit
4d65048d41
2 changed files with 1 additions and 31 deletions
|
@ -1,5 +1,4 @@
|
|||
// FIXME: check-pass
|
||||
// check-fail
|
||||
// check-pass
|
||||
// edition:2021
|
||||
|
||||
use std::fmt::{self, Display};
|
||||
|
@ -30,9 +29,7 @@ impl<'a, T> Future for WriteFmtFuture<'a, T> {
|
|||
|
||||
async fn async_main() {
|
||||
let _write = write!(&mut AsyncStdout, "...").await;
|
||||
//~^ ERROR temporary value dropped while borrowed
|
||||
let _writeln = writeln!(&mut AsyncStdout, "...").await;
|
||||
//~^ ERROR temporary value dropped while borrowed
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
error[E0716]: temporary value dropped while borrowed
|
||||
--> $DIR/format-args-temporaries-async.rs:32:30
|
||||
|
|
||||
LL | let _write = write!(&mut AsyncStdout, "...").await;
|
||||
| ------------^^^^^^^^^^^--------
|
||||
| | |
|
||||
| | creates a temporary which is freed while still in use
|
||||
| temporary value is freed at the end of this statement
|
||||
| borrow later used here
|
||||
|
|
||||
= note: consider using a `let` binding to create a longer lived value
|
||||
|
||||
error[E0716]: temporary value dropped while borrowed
|
||||
--> $DIR/format-args-temporaries-async.rs:34:34
|
||||
|
|
||||
LL | let _writeln = writeln!(&mut AsyncStdout, "...").await;
|
||||
| --------------^^^^^^^^^^^--------
|
||||
| | |
|
||||
| | creates a temporary which is freed while still in use
|
||||
| temporary value is freed at the end of this statement
|
||||
| borrow later used here
|
||||
|
|
||||
= note: consider using a `let` binding to create a longer lived value
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0716`.
|
Loading…
Add table
Reference in a new issue