| 1 |
#[lang = "sized"] |
| 2 |
pub trait Sized { |
| 3 |
// Empty. |
| 4 |
} |
| 5 |
|
| 6 |
#[lang = "fn_once"] |
| 7 |
pub trait FnOnce<Args> { |
| 8 |
/// The returned type after the call operator is used. |
| 9 |
#[lang = "fn_once_output"] |
| 10 |
type Output; |
| 11 |
|
| 12 |
/// Performs the call operation. |
| 13 |
extern "rust-call" fn call_once(self, args: Args) -> Self::Output; |
| 14 |
} |
| 15 |
|
| 16 |
pub enum Ordering { |
| 17 |
/// An ordering where a compared value is less than another. |
| 18 |
Less = -1, |
| 19 |
/// An ordering where a compared value is equal to another. |
| 20 |
Equal = 0, |
| 21 |
/// An ordering where a compared value is greater than another. |
| 22 |
Greater = 1, |
| 23 |
} |
| 24 |
|
| 25 |
pub fn f<F: FnOnce(i32) -> Ordering>(g: F) -> Ordering { |
| 26 |
g(1) |
| 27 |
} |