summaryrefslogtreecommitdiffstats
path: root/tests/ui/structs-enums/tuple-struct-constructor-pointer.rs
blob: 23f06516323133cf34b21f6164f8b3b7c4c5ab29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// 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));
}