File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ // This is a non-regression test for issue #114325: an "unexpected unsized tail" ICE happened during
2+ // codegen, and was fixed by MIR drop tracking #107421.
3+
4+ // edition: 2021
5+ // build-pass: ICEd during codegen.
6+
7+ #![ feature( impl_trait_in_assoc_type) ]
8+
9+ use std:: future:: Future ;
10+
11+ fn main ( ) {
12+ RuntimeRef :: spawn_local ( actor_fn ( http_actor) ) ;
13+ }
14+
15+ async fn http_actor ( ) {
16+ async fn respond ( body : impl Body ) {
17+ body. write_message ( ) . await ;
18+ }
19+
20+ respond ( & ( ) ) . await ;
21+ }
22+
23+ trait Body {
24+ type WriteFuture : Future ;
25+
26+ fn write_message ( self ) -> Self :: WriteFuture ;
27+ }
28+
29+ impl Body for & ' static ( ) {
30+ type WriteFuture = impl Future < Output = ( ) > ;
31+
32+ fn write_message ( self ) -> Self :: WriteFuture {
33+ async { }
34+ }
35+ }
36+
37+ trait NewActor {
38+ type RuntimeAccess ;
39+ }
40+
41+ fn actor_fn < T , A > ( _d : T ) -> ( T , A ) {
42+ loop { }
43+ }
44+
45+ impl < F : FnMut ( ) -> A , A > NewActor for ( F , A ) {
46+ type RuntimeAccess = RuntimeRef ;
47+ }
48+ struct RuntimeRef ( Vec < ( ) > ) ;
49+
50+ impl RuntimeRef {
51+ fn spawn_local < NA : NewActor < RuntimeAccess = RuntimeRef > > ( _f : NA ) {
52+ struct ActorFuture < NA : NewActor > ( NA :: RuntimeAccess ) ;
53+ ( ActorFuture :: < NA > ( RuntimeRef ( vec ! [ ] ) ) , _f) ;
54+ }
55+ }
You can’t perform that action at this time.
0 commit comments