1error: all if blocks contain the same code at the start and the end. Here at the start 2 --> $DIR/shared_at_top_and_bottom.rs:16:5 3 | 4LL | / if x == 7 { 5LL | | let t = 7; 6LL | | let _overlap_start = t * 2; 7LL | | let _overlap_end = 2 * t; 8 | |_________________________________^ 9 | 10note: the lint level is defined here 11 --> $DIR/shared_at_top_and_bottom.rs:2:36 12 | 13LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)] 14 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 15note: and here at the end 16 --> $DIR/shared_at_top_and_bottom.rs:28:5 17 | 18LL | / let _u = 9; 19LL | | } 20 | |_____^ 21help: consider moving the start statements out like this 22 | 23LL ~ let t = 7; 24LL + let _overlap_start = t * 2; 25LL + let _overlap_end = 2 * t; 26LL + if x == 7 { 27 | 28help: and consider moving the end statements out like this 29 | 30LL ~ } 31LL + let _u = 9; 32 | 33 34error: all if blocks contain the same code at the start and the end. Here at the start 35 --> $DIR/shared_at_top_and_bottom.rs:32:5 36 | 37LL | / if x == 99 { 38LL | | let r = 7; 39LL | | let _overlap_start = r; 40LL | | let _overlap_middle = r * r; 41 | |____________________________________^ 42 | 43note: and here at the end 44 --> $DIR/shared_at_top_and_bottom.rs:43:5 45 | 46LL | / let _overlap_end = r * r * r; 47LL | | let z = "end"; 48LL | | } 49 | |_____^ 50 = warning: Some moved values might need to be renamed to avoid wrong references 51help: consider moving the start statements out like this 52 | 53LL ~ let r = 7; 54LL + let _overlap_start = r; 55LL + let _overlap_middle = r * r; 56LL + if x == 99 { 57 | 58help: and consider moving the end statements out like this 59 | 60LL ~ } 61LL + let _overlap_end = r * r * r; 62LL + let z = "end"; 63 | 64 65error: all if blocks contain the same code at the start and the end. Here at the start 66 --> $DIR/shared_at_top_and_bottom.rs:61:5 67 | 68LL | / if (x > 7 && y < 13) || (x + y) % 2 == 1 { 69LL | | let a = 0xcafe; 70LL | | let b = 0xffff00ff; 71LL | | let e_id = gen_id(a, b); 72 | |________________________________^ 73 | 74note: and here at the end 75 --> $DIR/shared_at_top_and_bottom.rs:81:5 76 | 77LL | / let pack = DataPack { 78LL | | id: e_id, 79LL | | name: "Player 1".to_string(), 80LL | | some_data: vec![0x12, 0x34, 0x56, 0x78, 0x90], 81LL | | }; 82LL | | process_data(pack); 83LL | | } 84 | |_____^ 85 = warning: Some moved values might need to be renamed to avoid wrong references 86help: consider moving the start statements out like this 87 | 88LL ~ let a = 0xcafe; 89LL + let b = 0xffff00ff; 90LL + let e_id = gen_id(a, b); 91LL + if (x > 7 && y < 13) || (x + y) % 2 == 1 { 92 | 93help: and consider moving the end statements out like this 94 | 95LL ~ } 96LL + let pack = DataPack { 97LL + id: e_id, 98LL + name: "Player 1".to_string(), 99LL + some_data: vec![0x12, 0x34, 0x56, 0x78, 0x90], 100LL + }; 101 ... 102 103error: all if blocks contain the same code at the start and the end. Here at the start 104 --> $DIR/shared_at_top_and_bottom.rs:94:5 105 | 106LL | / let _ = if x == 7 { 107LL | | let _ = 19; 108 | |___________________^ 109 | 110note: and here at the end 111 --> $DIR/shared_at_top_and_bottom.rs:103:5 112 | 113LL | / x << 2 114LL | | }; 115 | |_____^ 116 = note: The end suggestion probably needs some adjustments to use the expression result correctly 117help: consider moving the start statements out like this 118 | 119LL ~ let _ = 19; 120LL + let _ = if x == 7 { 121 | 122help: and consider moving the end statements out like this 123 | 124LL ~ } 125LL ~ x << 2; 126 | 127 128error: all if blocks contain the same code at the start and the end. Here at the start 129 --> $DIR/shared_at_top_and_bottom.rs:106:5 130 | 131LL | / if x == 9 { 132LL | | let _ = 17; 133 | |___________________^ 134 | 135note: and here at the end 136 --> $DIR/shared_at_top_and_bottom.rs:115:5 137 | 138LL | / x * 4 139LL | | } 140 | |_____^ 141 = note: The end suggestion probably needs some adjustments to use the expression result correctly 142help: consider moving the start statements out like this 143 | 144LL ~ let _ = 17; 145LL + if x == 9 { 146 | 147help: and consider moving the end statements out like this 148 | 149LL ~ } 150LL + x * 4 151 | 152 153error: aborting due to 5 previous errors 154 155