File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ //@ check-pass
2+ // Regression test for issue https://github.com/rust-lang/rust/issues/143821
3+ // Tests that we don't ICE when borrow-checking nested closures with generic type parameters
4+ // and late-bound lifetime parameters.
5+
6+ fn data_ < T : ' static > ( _: & ( ) ) -> & T {
7+ loop { }
8+ }
9+
10+ fn register < T , F > ( f : F ) -> IfaceToken < T >
11+ where
12+ T : ' static ,
13+ F : FnOnce ( & ( ) ) ,
14+ {
15+ loop { }
16+ }
17+
18+ fn method_with_cr_async < CB > ( cb : CB )
19+ where
20+ CB : Fn ( ) ,
21+ {
22+ loop { }
23+ }
24+
25+ struct IfaceToken < T : ' static > ( T ) ;
26+
27+ fn foo < T > ( ) -> IfaceToken < T > {
28+ register :: < T , _ > ( |b : & ( ) | {
29+ method_with_cr_async ( || {
30+ data_ :: < T > ( & ( ) ) ;
31+ } ) ;
32+ } )
33+ }
34+
35+ struct A ( ) ;
36+
37+ fn main ( ) {
38+ foo :: < A > ( ) ;
39+ }
You can’t perform that action at this time.
0 commit comments