rust/tests/ui/structs-enums/tuple-struct-constructor-pointer.rs
2024-02-16 20:02:50 +00:00

13 lines
278 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));
}