File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ //@ edition: 2024
2+ //@ revisions: current next
3+ //@[next] compile-flags: -Znext-solver
4+ //@ check-pass
5+
6+ // Regression test for #146813. We previously used a pseudo-canonical
7+ // query during HIR typeck which caused a query cycle when looking at the
8+ // witness of a coroutine.
9+
10+ use std:: future:: Future ;
11+
12+ trait ConnectMiddleware { }
13+
14+ trait ConnectHandler : Sized {
15+ fn with < M > ( self , _: M ) -> impl ConnectHandler
16+ where
17+ M : ConnectMiddleware ,
18+ {
19+ LayeredConnectHandler
20+ }
21+ }
22+
23+ struct LayeredConnectHandler ;
24+ impl ConnectHandler for LayeredConnectHandler { }
25+ impl < F > ConnectHandler for F where F : FnOnce ( ) { }
26+
27+ impl < F , Fut > ConnectMiddleware for F
28+ where
29+ F : FnOnce ( ) -> Fut ,
30+ Fut : Future < Output = ( ) > + Send ,
31+ {
32+ }
33+
34+ pub async fn fails ( ) {
35+ { || { } }
36+ . with ( async || ( ) )
37+ . with ( async || ( ) )
38+ . with ( async || ( ) ) ;
39+ }
40+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments