Skip to content

Commit 427a453

Browse files
committed
Auto merge of rust-lang#112198 - compiler-errors:rollup-o2xe4of, r=compiler-errors
Rollup of 7 pull requests Successful merges: - rust-lang#111670 (Require that const param tys implement `ConstParamTy`) - rust-lang#111914 (CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…) - rust-lang#112030 (Migrate `item_trait_alias` to Askama) - rust-lang#112150 (Support 128-bit atomics on all x86_64 Apple targets) - rust-lang#112174 (Fix broken link) - rust-lang#112190 (Improve comments on `TyCtxt` and `GlobalCtxt`.) - rust-lang#112193 (Check tuple elements are `Sized` in `offset_of`) Failed merges: - rust-lang#112071 (Group rfcs tests) r? `@ghost` `@rustbot` modify labels: rollup
2 parents ec2c615 + b4f074c commit 427a453

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

tests/ui/same_functions_in_if_condition.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
clippy::uninlined_format_args
1111
)]
1212

13+
use std::marker::ConstParamTy;
14+
1315
fn function() -> bool {
1416
true
1517
}
@@ -96,7 +98,7 @@ fn main() {
9698
};
9799
println!("{}", os);
98100

99-
#[derive(PartialEq, Eq)]
101+
#[derive(PartialEq, Eq, ConstParamTy)]
100102
enum E {
101103
A,
102104
B,

tests/ui/same_functions_in_if_condition.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: this `if` has the same function call as a previous `if`
2-
--> $DIR/same_functions_in_if_condition.rs:37:15
2+
--> $DIR/same_functions_in_if_condition.rs:39:15
33
|
44
LL | } else if function() {
55
| ^^^^^^^^^^
66
|
77
note: same as this
8-
--> $DIR/same_functions_in_if_condition.rs:36:8
8+
--> $DIR/same_functions_in_if_condition.rs:38:8
99
|
1010
LL | if function() {
1111
| ^^^^^^^^^^
@@ -16,61 +16,61 @@ LL | #![deny(clippy::same_functions_in_if_condition)]
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1717

1818
error: this `if` has the same function call as a previous `if`
19-
--> $DIR/same_functions_in_if_condition.rs:42:15
19+
--> $DIR/same_functions_in_if_condition.rs:44:15
2020
|
2121
LL | } else if fn_arg(a) {
2222
| ^^^^^^^^^
2323
|
2424
note: same as this
25-
--> $DIR/same_functions_in_if_condition.rs:41:8
25+
--> $DIR/same_functions_in_if_condition.rs:43:8
2626
|
2727
LL | if fn_arg(a) {
2828
| ^^^^^^^^^
2929

3030
error: this `if` has the same function call as a previous `if`
31-
--> $DIR/same_functions_in_if_condition.rs:47:15
31+
--> $DIR/same_functions_in_if_condition.rs:49:15
3232
|
3333
LL | } else if obj.method() {
3434
| ^^^^^^^^^^^^
3535
|
3636
note: same as this
37-
--> $DIR/same_functions_in_if_condition.rs:46:8
37+
--> $DIR/same_functions_in_if_condition.rs:48:8
3838
|
3939
LL | if obj.method() {
4040
| ^^^^^^^^^^^^
4141

4242
error: this `if` has the same function call as a previous `if`
43-
--> $DIR/same_functions_in_if_condition.rs:52:15
43+
--> $DIR/same_functions_in_if_condition.rs:54:15
4444
|
4545
LL | } else if obj.method_arg(a) {
4646
| ^^^^^^^^^^^^^^^^^
4747
|
4848
note: same as this
49-
--> $DIR/same_functions_in_if_condition.rs:51:8
49+
--> $DIR/same_functions_in_if_condition.rs:53:8
5050
|
5151
LL | if obj.method_arg(a) {
5252
| ^^^^^^^^^^^^^^^^^
5353

5454
error: this `if` has the same function call as a previous `if`
55-
--> $DIR/same_functions_in_if_condition.rs:59:15
55+
--> $DIR/same_functions_in_if_condition.rs:61:15
5656
|
5757
LL | } else if v.pop().is_none() {
5858
| ^^^^^^^^^^^^^^^^^
5959
|
6060
note: same as this
61-
--> $DIR/same_functions_in_if_condition.rs:57:8
61+
--> $DIR/same_functions_in_if_condition.rs:59:8
6262
|
6363
LL | if v.pop().is_none() {
6464
| ^^^^^^^^^^^^^^^^^
6565

6666
error: this `if` has the same function call as a previous `if`
67-
--> $DIR/same_functions_in_if_condition.rs:64:15
67+
--> $DIR/same_functions_in_if_condition.rs:66:15
6868
|
6969
LL | } else if v.len() == 42 {
7070
| ^^^^^^^^^^^^^
7171
|
7272
note: same as this
73-
--> $DIR/same_functions_in_if_condition.rs:62:8
73+
--> $DIR/same_functions_in_if_condition.rs:64:8
7474
|
7575
LL | if v.len() == 42 {
7676
| ^^^^^^^^^^^^^

0 commit comments

Comments
 (0)