1error: all if blocks contain the same code at the end 2 --> $DIR/shared_at_bottom.rs:30:5 3 | 4LL | / let result = false; 5LL | | println!("Block end!"); 6LL | | result 7LL | | }; 8 | |_____^ 9 | 10note: the lint level is defined here 11 --> $DIR/shared_at_bottom.rs:2:36 12 | 13LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)] 14 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 15 = note: The end suggestion probably needs some adjustments to use the expression result correctly 16help: consider moving the end statements out like this 17 | 18LL ~ } 19LL + let result = false; 20LL + println!("Block end!"); 21LL ~ result; 22 | 23 24error: all if blocks contain the same code at the end 25 --> $DIR/shared_at_bottom.rs:48:5 26 | 27LL | / println!("Same end of block"); 28LL | | } 29 | |_____^ 30 | 31help: consider moving the end statements out like this 32 | 33LL ~ } 34LL + println!("Same end of block"); 35 | 36 37error: all if blocks contain the same code at the end 38 --> $DIR/shared_at_bottom.rs:65:5 39 | 40LL | / println!( 41LL | | "I'm moveable because I know: `outer_scope_value`: '{}'", 42LL | | outer_scope_value 43LL | | ); 44LL | | } 45 | |_____^ 46 | 47help: consider moving the end statements out like this 48 | 49LL ~ } 50LL + println!( 51LL + "I'm moveable because I know: `outer_scope_value`: '{}'", 52LL + outer_scope_value 53LL + ); 54 | 55 56error: all if blocks contain the same code at the end 57 --> $DIR/shared_at_bottom.rs:77:9 58 | 59LL | / println!("Hello World"); 60LL | | } 61 | |_________^ 62 | 63help: consider moving the end statements out like this 64 | 65LL ~ } 66LL + println!("Hello World"); 67 | 68 69error: all if blocks contain the same code at the end 70 --> $DIR/shared_at_bottom.rs:93:5 71 | 72LL | / let later_used_value = "A string value"; 73LL | | println!("{}", later_used_value); 74LL | | // I'm expecting a note about this 75LL | | } 76 | |_____^ 77 | 78 = warning: Some moved values might need to be renamed to avoid wrong references 79help: consider moving the end statements out like this 80 | 81LL ~ } 82LL + let later_used_value = "A string value"; 83LL + println!("{}", later_used_value); 84 | 85 86error: all if blocks contain the same code at the end 87 --> $DIR/shared_at_bottom.rs:106:5 88 | 89LL | / let simple_examples = "I now identify as a &str :)"; 90LL | | println!("This is the new simple_example: {}", simple_examples); 91LL | | } 92 | |_____^ 93 | 94 = warning: Some moved values might need to be renamed to avoid wrong references 95help: consider moving the end statements out like this 96 | 97LL ~ } 98LL + let simple_examples = "I now identify as a &str :)"; 99LL + println!("This is the new simple_example: {}", simple_examples); 100 | 101 102error: all if blocks contain the same code at the end 103 --> $DIR/shared_at_bottom.rs:171:5 104 | 105LL | / x << 2 106LL | | }; 107 | |_____^ 108 | 109 = note: The end suggestion probably needs some adjustments to use the expression result correctly 110help: consider moving the end statements out like this 111 | 112LL ~ } 113LL ~ x << 2; 114 | 115 116error: all if blocks contain the same code at the end 117 --> $DIR/shared_at_bottom.rs:178:5 118 | 119LL | / x * 4 120LL | | } 121 | |_____^ 122 | 123 = note: The end suggestion probably needs some adjustments to use the expression result correctly 124help: consider moving the end statements out like this 125 | 126LL ~ } 127LL + x * 4 128 | 129 130error: all if blocks contain the same code at the end 131 --> $DIR/shared_at_bottom.rs:190:44 132 | 133LL | if x == 17 { b = 1; a = 0x99; } else { a = 0x99; } 134 | ^^^^^^^^^^^ 135 | 136help: consider moving the end statements out like this 137 | 138LL ~ if x == 17 { b = 1; a = 0x99; } else { } 139LL + a = 0x99; 140 | 141 142error: aborting due to 9 previous errors 143 144