Rollup merge of #68212 - csmoe:temp, r=estebank
Suggest to shorten temporary lifetime during method call inside generator Closes https://github.com/rust-lang/rust/issues/67376  r? @estebank cc @tmandry @nikomatsakis
This commit is contained in:
commit
ae1e75bf4e
7 changed files with 60 additions and 16 deletions
|
|
@ -16,6 +16,11 @@ LL | let _x = get().await;
|
|||
...
|
||||
LL | }
|
||||
| - `client` is later dropped here
|
||||
help: consider moving this method call into a `let` binding to create a shorter lived borrow
|
||||
--> $DIR/issue-64130-4-async-move.rs:19:15
|
||||
|
|
||||
LL | match client.status() {
|
||||
| ^^^^^^^^^^^^^^^
|
||||
= note: the return type of a function must have a statically known size
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ LL | fn assert_sync<T: Sync>(_: T) {}
|
|||
LL | assert_sync(|| {
|
||||
| ^^^^^^^^^^^ future returned by `main` is not `Sync`
|
||||
|
|
||||
= help: within `[generator@$DIR/not-send-sync.rs:9:17: 13:6 {std::cell::Cell<i32>, ()}]`, the trait `std::marker::Sync` is not implemented for `std::cell::Cell<i32>`
|
||||
= help: within `[generator@$DIR/not-send-sync.rs:9:17: 13:6 {std::cell::Cell<i32>, (), ()}]`, the trait `std::marker::Sync` is not implemented for `std::cell::Cell<i32>`
|
||||
note: future is not `Sync` as this value is used across an yield
|
||||
--> $DIR/not-send-sync.rs:12:9
|
||||
|
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ error[E0720]: opaque type expands to a recursive type
|
|||
LL | fn generator_capture() -> impl Sized {
|
||||
| ^^^^^^^^^^ expands to a recursive type
|
||||
|
|
||||
= note: expanded type is `[generator@$DIR/recursive-impl-trait-type-indirect.rs:50:5: 50:26 x:impl Sized {()}]`
|
||||
= note: expanded type is `[generator@$DIR/recursive-impl-trait-type-indirect.rs:50:5: 50:26 x:impl Sized {(), ()}]`
|
||||
|
||||
error[E0720]: opaque type expands to a recursive type
|
||||
--> $DIR/recursive-impl-trait-type-indirect.rs:53:26
|
||||
|
|
@ -92,7 +92,7 @@ error[E0720]: opaque type expands to a recursive type
|
|||
LL | fn generator_hold() -> impl Sized {
|
||||
| ^^^^^^^^^^ expands to a recursive type
|
||||
|
|
||||
= note: expanded type is `[generator@$DIR/recursive-impl-trait-type-indirect.rs:58:5: 62:6 {impl Sized, ()}]`
|
||||
= note: expanded type is `[generator@$DIR/recursive-impl-trait-type-indirect.rs:58:5: 62:6 {impl Sized, (), ()}]`
|
||||
|
||||
error[E0720]: opaque type expands to a recursive type
|
||||
--> $DIR/recursive-impl-trait-type-indirect.rs:69:26
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue