Move /src/test to /tests
This commit is contained in:
parent
ca855e6e42
commit
cf2dff2b1e
27592 changed files with 0 additions and 0 deletions
11
tests/ui/functions-closures/closure-inference.rs
Normal file
11
tests/ui/functions-closures/closure-inference.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
// run-pass
|
||||
#![allow(unused_braces)]
|
||||
|
||||
fn foo(i: isize) -> isize { i + 1 }
|
||||
|
||||
fn apply<A, F>(f: F, v: A) -> A where F: FnOnce(A) -> A { f(v) }
|
||||
|
||||
pub fn main() {
|
||||
let f = {|i| foo(i)};
|
||||
assert_eq!(apply(f, 2), 3);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue