2023-12-08 13:09:10 -06:00
|
|
|
|
// Make sure "highlighted" code is colored purple
|
|
|
|
|
|
|
|
|
|
//@ compile-flags: --error-format=human --color=always
|
|
|
|
|
//@ error-pattern:[35mfor<'a> [0m
|
|
|
|
|
//@ edition:2018
|
2024-03-02 16:36:52 -06:00
|
|
|
|
// Temporary until next release:
|
|
|
|
|
//@ ignore-stage2
|
2023-12-09 07:40:55 -06:00
|
|
|
|
|
2023-12-08 13:09:10 -06:00
|
|
|
|
use core::pin::Pin;
|
|
|
|
|
use core::future::Future;
|
|
|
|
|
use core::any::Any;
|
|
|
|
|
|
|
|
|
|
fn query(_: fn(Box<(dyn Any + Send + '_)>) -> Pin<Box<(
|
|
|
|
|
dyn Future<Output = Result<Box<(dyn Any + 'static)>, String>> + Send + 'static
|
|
|
|
|
)>>) {}
|
|
|
|
|
|
|
|
|
|
fn wrapped_fn<'a>(_: Box<(dyn Any + Send)>) -> Pin<Box<(
|
|
|
|
|
dyn Future<Output = Result<Box<(dyn Any + 'static)>, String>> + Send + 'static
|
|
|
|
|
)>> {
|
|
|
|
|
Box::pin(async { Err("nope".into()) })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
query(wrapped_fn);
|
|
|
|
|
}
|