rust/tests/ui/functions-closures/closure-inference2.rs
2024-02-16 20:02:50 +00:00

10 lines
169 B
Rust

//@ run-pass
// Test a rather underspecified example:
#![allow(unused_braces)]
pub fn main() {
let f = {|i| i};
assert_eq!(f(2), 2);
assert_eq!(f(5), 5);
}