2019-01-02 17:14:24 +03:00
|
|
|
#![feature(fn_traits)]
|
|
|
|
|
|
2017-02-23 14:04:09 +09:00
|
|
|
struct Test;
|
|
|
|
|
|
|
|
|
|
impl FnOnce<(u32, u32)> for Test {
|
2019-01-02 17:14:24 +03:00
|
|
|
//~^ ERROR the precise format of `Fn`-family traits' type parameters is subject to change
|
2020-04-16 02:00:23 +02:00
|
|
|
//~| ERROR manual implementations of `FnOnce` are experimental
|
2017-02-23 14:04:09 +09:00
|
|
|
type Output = u32;
|
|
|
|
|
|
|
|
|
|
extern "rust-call" fn call_once(self, (a, b): (u32, u32)) -> u32 {
|
|
|
|
|
a + b
|
|
|
|
|
}
|
2025-02-05 11:15:27 -08:00
|
|
|
//~^^^ ERROR "rust-call" ABI is experimental and subject to change
|
2017-02-23 14:04:09 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
assert_eq!(Test(1u32, 2u32), 3u32);
|
|
|
|
|
}
|