rust/tests/ui/structs-enums/tuple-struct-constructor-pointer.rs
2023-01-11 09:32:08 +00:00

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