parent
dad01bc9a8
commit
34182f6e7d
1 changed files with 40 additions and 0 deletions
40
tests/ui/coroutine/copy-fast-path-query-cycle.rs
Normal file
40
tests/ui/coroutine/copy-fast-path-query-cycle.rs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
//@ edition: 2024
|
||||
//@ revisions: current next
|
||||
//@[next] compile-flags: -Znext-solver
|
||||
//@ check-pass
|
||||
|
||||
// Regression test for #146813. We previously used a pseudo-canonical
|
||||
// query during HIR typeck which caused a query cycle when looking at the
|
||||
// witness of a coroutine.
|
||||
|
||||
use std::future::Future;
|
||||
|
||||
trait ConnectMiddleware {}
|
||||
|
||||
trait ConnectHandler: Sized {
|
||||
fn with<M>(self, _: M) -> impl ConnectHandler
|
||||
where
|
||||
M: ConnectMiddleware,
|
||||
{
|
||||
LayeredConnectHandler
|
||||
}
|
||||
}
|
||||
|
||||
struct LayeredConnectHandler;
|
||||
impl ConnectHandler for LayeredConnectHandler {}
|
||||
impl<F> ConnectHandler for F where F: FnOnce() {}
|
||||
|
||||
impl<F, Fut> ConnectMiddleware for F
|
||||
where
|
||||
F: FnOnce() -> Fut,
|
||||
Fut: Future<Output = ()> + Send,
|
||||
{
|
||||
}
|
||||
|
||||
pub async fn fails() {
|
||||
{ || {} }
|
||||
.with(async || ())
|
||||
.with(async || ())
|
||||
.with(async || ());
|
||||
}
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue