1- error: All if blocks contain the same code at the end
2- --> $DIR/shared_at_bot.rs:31 :5
1+ error: all if blocks contain the same code at the end
2+ --> $DIR/shared_at_bot.rs:30 :5
33 |
44LL | / let result = false;
55LL | | println!("Block end!");
@@ -13,16 +13,29 @@ note: the lint level is defined here
1313LL | #![deny(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)]
1414 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1515 = note: The end suggestion probably needs some adjustments to use the expression result correctly.
16- help: Consider moving the end statements out like this
16+ help: consider moving the end statements out like this
1717 |
1818LL | }
1919LL | let result = false;
2020LL | println!("Block end!");
2121LL | result;
2222 |
2323
24- error: All if blocks contain the same code at the end
25- --> $DIR/shared_at_bot.rs:66:5
24+ error: all if blocks contain the same code at the end
25+ --> $DIR/shared_at_bot.rs:48:5
26+ |
27+ LL | / println!("Same end of block");
28+ LL | | }
29+ | |_____^
30+ |
31+ help: consider moving the end statements out like this
32+ |
33+ LL | }
34+ LL | println!("Same end of block");
35+ |
36+
37+ error: all if blocks contain the same code at the end
38+ --> $DIR/shared_at_bot.rs:65:5
2639 |
2740LL | / println!(
2841LL | | "I'm moveable because I know: `outer_scope_value`: '{}'",
@@ -31,7 +44,7 @@ LL | | );
3144LL | | }
3245 | |_____^
3346 |
34- help: Consider moving the end statements out like this
47+ help: consider moving the end statements out like this
3548 |
3649LL | }
3750LL | println!(
@@ -40,22 +53,21 @@ LL | outer_scope_value
4053LL | );
4154 |
4255
43- error: All if blocks contain the same code at the start
44- --> $DIR/shared_at_bot.rs:83 :9
56+ error: all if blocks contain the same code at the end
57+ --> $DIR/shared_at_bot.rs:77 :9
4558 |
46- LL | / if x == 8 {
47- LL | | // No parent!!
48- LL | | println!("Hello World");
49- | |____________________________________^
59+ LL | / println!("Hello World");
60+ LL | | }
61+ | |_________^
5062 |
51- help: Consider moving the start statements out like this
63+ help: consider moving the end statements out like this
5264 |
65+ LL | }
5366LL | println!("Hello World");
54- LL | if x == 8 {
5567 |
5668
57- error: All if blocks contain the same code at the end
58- --> $DIR/shared_at_bot.rs:104 :5
69+ error: all if blocks contain the same code at the end
70+ --> $DIR/shared_at_bot.rs:93 :5
5971 |
6072LL | / let later_used_value = "A string value";
6173LL | | println!("{}", later_used_value);
@@ -64,68 +76,68 @@ LL | | }
6476 | |_____^
6577 |
6678 = warning: Some moved values might need to be renamed to avoid wrong references.
67- help: Consider moving the end statements out like this
79+ help: consider moving the end statements out like this
6880 |
6981LL | }
7082LL | let later_used_value = "A string value";
7183LL | println!("{}", later_used_value);
7284 |
7385
74- error: All if blocks contain the same code at the end
75- --> $DIR/shared_at_bot.rs:117 :5
86+ error: all if blocks contain the same code at the end
87+ --> $DIR/shared_at_bot.rs:106 :5
7688 |
7789LL | / let simple_examples = "I now identify as a &str :)";
7890LL | | println!("This is the new simple_example: {}", simple_examples);
7991LL | | }
8092 | |_____^
8193 |
8294 = warning: Some moved values might need to be renamed to avoid wrong references.
83- help: Consider moving the end statements out like this
95+ help: consider moving the end statements out like this
8496 |
8597LL | }
8698LL | let simple_examples = "I now identify as a &str :)";
8799LL | println!("This is the new simple_example: {}", simple_examples);
88100 |
89101
90- error: All if blocks contain the same code at the end
91- --> $DIR/shared_at_bot.rs:182 :5
102+ error: all if blocks contain the same code at the end
103+ --> $DIR/shared_at_bot.rs:171 :5
92104 |
93105LL | / x << 2
94106LL | | };
95107 | |_____^
96108 |
97109 = note: The end suggestion probably needs some adjustments to use the expression result correctly.
98- help: Consider moving the end statements out like this
110+ help: consider moving the end statements out like this
99111 |
100112LL | }
101113LL | x << 2;
102114 |
103115
104- error: All if blocks contain the same code at the end
105- --> $DIR/shared_at_bot.rs:189 :5
116+ error: all if blocks contain the same code at the end
117+ --> $DIR/shared_at_bot.rs:178 :5
106118 |
107119LL | / x * 4
108120LL | | }
109121 | |_____^
110122 |
111123 = note: The end suggestion probably needs some adjustments to use the expression result correctly.
112- help: Consider moving the end statements out like this
124+ help: consider moving the end statements out like this
113125 |
114126LL | }
115127LL | x * 4
116128 |
117129
118- error: All if blocks contain the same code at the end
119- --> $DIR/shared_at_bot.rs:201 :44
130+ error: all if blocks contain the same code at the end
131+ --> $DIR/shared_at_bot.rs:190 :44
120132 |
121133LL | if x == 17 { b = 1; a = 0x99; } else { a = 0x99; }
122134 | ^^^^^^^^^^^
123135 |
124- help: Consider moving the end statements out like this
136+ help: consider moving the end statements out like this
125137 |
126138LL | if x == 17 { b = 1; a = 0x99; } else { }
127139LL | a = 0x99;
128140 |
129141
130- error: aborting due to 8 previous errors
142+ error: aborting due to 9 previous errors
131143
0 commit comments