Skip to content

Commit 7a0adc0

Browse files
committed
add test
1 parent 83532f8 commit 7a0adc0

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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() {}

0 commit comments

Comments
 (0)