We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e751a30 commit 912d502Copy full SHA for 912d502
crates/bevy_reflect/compile_fail/tests/into_function/closure_fail.rs
@@ -0,0 +1,20 @@
1
+//@no-rustfix
2
+#![allow(unused)]
3
+
4
+use bevy_reflect::func::IntoFunction;
5
+use bevy_reflect::Reflect;
6
7
+fn main() {
8
+ let value = String::from("Hello, World!");
9
+ let closure_capture_owned = move || println!("{}", value);
10
11
+ // Should pass:
12
+ let _ = closure_capture_owned.into_function();
13
14
15
+ let closure_capture_reference = || println!("{}", &value);
16
+ //~^ E0373
17
18
+ // Above error due to this line:
19
+ let _ = closure_capture_reference.into_function();
20
+}
0 commit comments