summaryrefslogtreecommitdiffstats
path: root/tests/ui/error-emitter/highlighting.rs
blob: fd61b2b05ff965588c9b080d00071d2c043003f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Make sure "highlighted" code is colored purple

// compile-flags: --error-format=human --color=always
// error-pattern:for<'a> 
// edition:2018

// revisions: windows not-windows
// [windows]only-windows
// [not-windows]ignore-windows

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);
}