mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
13 lines
277 B
Rust
13 lines
277 B
Rust
// run-pass
|
|
#[derive(PartialEq, Debug)]
|
|
struct Foo(isize);
|
|
#[derive(PartialEq, Debug)]
|
|
struct Bar(isize, isize);
|
|
|
|
pub fn main() {
|
|
let f: fn(isize) -> Foo = Foo;
|
|
let g: fn(isize, isize) -> Bar = Bar;
|
|
assert_eq!(f(42), Foo(42));
|
|
assert_eq!(g(4, 7), Bar(4, 7));
|
|
}
|