mod foo { pub fn bar() {} }
fn main() {
match () {
foo::bar => {}
}
}
function-match.rs:4:9: 4:17 error: mismatched types: expected `()` but found an enum or structure pattern
function-match.rs:4 foo::bar => {}
^~~~~~~~
This should be complaining about mismatched types.
(The module is necessary to force the compiler search/use the function; with just bar => {} it takes bar to be a variable binding.)
This should be complaining about mismatched types.
(The module is necessary to force the compiler search/use the function; with just
bar => {}it takesbarto be a variable binding.)