Skip to content

Commit 6e19cfa

Browse files
committed
more tests
1 parent ca5c694 commit 6e19cfa

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/test/run-pass/issue-25180.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,21 @@
1010

1111
// pretty-expanded FIXME #25180
1212

13-
const x: &'static Fn() = &|| println!("ICE here");
13+
const empty: &'static Fn() = &|| println!("ICE here");
1414

15-
fn main() {
16-
x()
15+
const one_argument: &'static Fn(u32) = &|y| println("{}", y);
16+
17+
const plus_21: &'static Fn(u32) -> u32 = |y| y + 21;
18+
19+
const multi_and_local: &'static Fn(u32, u32) -> u32 = |x, y| {
20+
let tmp = x + y;
21+
tmp * 2;
22+
};
23+
24+
pub fn main() {
25+
empty();
26+
one_argument(42);
27+
assert!(plus_21(21) == 42);
28+
assert!(multi_and_local(1, 2) == 6);
1729
}
1830

0 commit comments

Comments
 (0)