mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-01 20:47:36 +00:00

Passing an explicit boolean value (`on`, `off` etc.) appears to work, but actually puts the compiler into an unintended state where unstable _options_ are still forbidden, but unstable values of _some_ stable options are allowed.
22 lines
559 B
Rust
22 lines
559 B
Rust
//@ compile-flags: -Zunstable-options --error-format=human-unicode --color=always
|
|
//@ edition:2018
|
|
//@ only-linux
|
|
|
|
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);
|
|
}
|