File tree 3 files changed +32
-0
lines changed
compiler/rustc_borrowck/src/region_infer
3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -1167,6 +1167,10 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1167
1167
self . scc_values . elements_contained_in ( lower_bound_scc) . next ( ) . is_none ( )
1168
1168
}
1169
1169
1170
+ // FIXME: this is likely to be incorrect, but it side-steps stable ICE #76168,
1171
+ // without any changes to what we accept (or reject for that matter).
1172
+ VerifyBound :: OutlivedBy ( ty:: RePlaceholder ( ..) ) => false ,
1173
+
1170
1174
VerifyBound :: OutlivedBy ( r) => {
1171
1175
let r_vid = self . to_region_vid ( r) ;
1172
1176
self . eval_outlives ( r_vid, lower_bound)
Original file line number Diff line number Diff line change
1
+ // edition:2018
2
+ #![ feature( unboxed_closures) ]
3
+ use std:: future:: Future ;
4
+
5
+ async fn wrapper < F > ( f : F )
6
+ where for < ' a > F : FnOnce < ( & ' a mut i32 , ) > ,
7
+ for < ' a > <F as FnOnce < ( & ' a mut i32 , ) > >:: Output : Future < Output =( ) > + ' a
8
+ { //~ ERROR `<F as FnOnce<(&'a mut i32,)>>::Output` does not live long enough
9
+ let mut i = 41 ;
10
+ f ( & mut i) . await ;
11
+ }
12
+
13
+ async fn add_one ( i : & mut i32 ) {
14
+ * i = * i + 1 ;
15
+ }
16
+
17
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error: `<F as FnOnce<(&'a mut i32,)>>::Output` does not live long enough
2
+ --> $DIR/issue-76168.rs:8:1
3
+ |
4
+ LL | / {
5
+ LL | | let mut i = 41;
6
+ LL | | f(&mut i).await;
7
+ LL | | }
8
+ | |_^
9
+
10
+ error: aborting due to previous error
11
+
You can’t perform that action at this time.
0 commit comments