We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca5c694 commit 6e19cfaCopy full SHA for 6e19cfa
src/test/run-pass/issue-25180.rs
@@ -10,9 +10,21 @@
10
11
// pretty-expanded FIXME #25180
12
13
-const x: &'static Fn() = &|| println!("ICE here");
+const empty: &'static Fn() = &|| println!("ICE here");
14
15
-fn main() {
16
- x()
+const one_argument: &'static Fn(u32) = &|y| println("{}", y);
+
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);
29
}
30
0 commit comments