mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
21 lines
286 B
Rust
21 lines
286 B
Rust
#![crate_type = "lib"]
|
|
pub trait Future {
|
|
type Item;
|
|
type Error;
|
|
}
|
|
|
|
impl Future for u32 {
|
|
type Item = ();
|
|
type Error = Box<()>;
|
|
}
|
|
|
|
fn foo() -> Box<Future<Item=(), Error=Box<()>>> {
|
|
Box::new(0u32)
|
|
}
|
|
|
|
pub fn bar<F, A, B>(_s: F)
|
|
where F: Fn(A) -> B,
|
|
{
|
|
foo();
|
|
}
|