@@ -100,7 +100,6 @@ LL | let c = async || { println!("{}", *x.0); };
100100LL | outlives::<'a>(c());
101101LL | outlives::<'a>(call_once(c));
102102 | ------------ argument requires that `x` is borrowed for `'a`
103- ...
104103LL | }
105104 | - `x` dropped here while still borrowed
106105
@@ -114,23 +113,31 @@ LL | outlives::<'a>(call_once(c));
114113 | ^^^^^^^^^^^^ lifetime `'a` required
115114
116115error[E0597]: `c` does not live long enough
117- --> $DIR/without-precise-captures-we-are-powerless.rs:43 :20
116+ --> $DIR/without-precise-captures-we-are-powerless.rs:45 :20
118117 |
119- LL | fn through_field_and_ref<'a>(x: &S<'a>) {
120- | -- lifetime `'a` defined here
121- ...
118+ LL | fn through_field_and_ref_move<'a>(x: &S<'a>) {
119+ | -- lifetime `'a` defined here
122120LL | let c = async move || { println!("{}", *x.0); };
123121 | - binding `c` declared here
124122LL | outlives::<'a>(c());
125123 | ^--
126124 | |
127125 | borrowed value does not live long enough
128126 | argument requires that `c` is borrowed for `'a`
129- LL | // outlives::<'a>(call_once(c)); // FIXME(async_closures): Figure out why this fails
127+ LL | outlives::<'a>(call_once(c));
130128LL | }
131129 | - `c` dropped here while still borrowed
132130
133- error: aborting due to 9 previous errors
131+ error[E0621]: explicit lifetime required in the type of `x`
132+ --> $DIR/without-precise-captures-we-are-powerless.rs:46:20
133+ |
134+ LL | fn through_field_and_ref_move<'a>(x: &S<'a>) {
135+ | ------ help: add explicit lifetime `'a` to the type of `x`: `&'a S<'a>`
136+ ...
137+ LL | outlives::<'a>(call_once(c));
138+ | ^^^^^^^^^^^^ lifetime `'a` required
139+
140+ error: aborting due to 10 previous errors
134141
135142Some errors have detailed explanations: E0505, E0597, E0621.
136143For more information about an error, try `rustc --explain E0505`.
0 commit comments