4 const PATTERN_REF: &str = "Hello World";
5 const NUMBER: i32 = 30;
6 const NUMBER_POINTER: *const i32 = &NUMBER;
8 pub fn edge_case_ref(event: &str) {
17 pub fn edge_case_str(event: String) {
19 match event.as_str() {
26 pub fn edge_case_raw_ptr(event: *const i32) {
35 pub fn edge_case_char(event: char) {
55 let sv = SingleVariant::A;
57 // sv should not be captured as it is a SingleVariant
60 SingleVariant::A if condition => (),
67 // ts should be captured
68 let ts = TestStruct { x: 1, y: 1, z: 1 };
69 let _b = || { match ts {
70 TestStruct{ x: 1, .. } => (),
74 //~^ ERROR: cannot move out of `ts` because it is borrowed