Skip to content

Commit 2e1e574

Browse files
committed
fix ui tests
these ui changes are closer to what was there before const_trait_impl changes.
1 parent b80d44e commit 2e1e574

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

tests/ui/suggestions/invalid-bin-op.stderr

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ help: consider annotating `S<T>` with `#[derive(PartialEq)]`
1616
LL + #[derive(PartialEq)]
1717
LL | struct S<T>(T);
1818
|
19+
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
20+
|
21+
LL | pub fn foo<T>(s: S<T>, t: S<T>) where S<T>: PartialEq {
22+
| +++++++++++++++++++++
1923

2024
error: aborting due to 1 previous error
2125

tests/ui/ufcs/ufcs-qpath-self-mismatch.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ fn main() {
44
<i32 as Add<u32>>::add(1, 2);
55
//~^ ERROR cannot add `u32` to `i32`
66
//~| ERROR cannot add `u32` to `i32`
7+
//~| ERROR cannot add `u32` to `i32`
78
<i32 as Add<i32>>::add(1u32, 2);
89
//~^ ERROR mismatched types
910
<i32 as Add<i32>>::add(1, 2u32);

tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr

+18-5
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,29 @@ LL | <i32 as Add<u32>>::add(1, 2);
1111
<&'a i32 as Add<i32>>
1212
<&i32 as Add<&i32>>
1313

14+
error[E0277]: cannot add `u32` to `i32`
15+
--> $DIR/ufcs-qpath-self-mismatch.rs:4:5
16+
|
17+
LL | <i32 as Add<u32>>::add(1, 2);
18+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32`
19+
|
20+
= help: the trait `Add<u32>` is not implemented for `i32`
21+
= help: the following other types implement trait `Add<Rhs>`:
22+
<i32 as Add>
23+
<i32 as Add<&i32>>
24+
<&'a i32 as Add<i32>>
25+
<&i32 as Add<&i32>>
26+
1427
error[E0308]: mismatched types
15-
--> $DIR/ufcs-qpath-self-mismatch.rs:7:28
28+
--> $DIR/ufcs-qpath-self-mismatch.rs:8:28
1629
|
1730
LL | <i32 as Add<i32>>::add(1u32, 2);
1831
| ---------------------- ^^^^ expected `i32`, found `u32`
1932
| |
2033
| arguments to this function are incorrect
2134
|
2235
help: the return type of this call is `u32` due to the type of the argument passed
23-
--> $DIR/ufcs-qpath-self-mismatch.rs:7:5
36+
--> $DIR/ufcs-qpath-self-mismatch.rs:8:5
2437
|
2538
LL | <i32 as Add<i32>>::add(1u32, 2);
2639
| ^^^^^^^^^^^^^^^^^^^^^^^----^^^^
@@ -34,15 +47,15 @@ LL | <i32 as Add<i32>>::add(1i32, 2);
3447
| ~~~
3548

3649
error[E0308]: mismatched types
37-
--> $DIR/ufcs-qpath-self-mismatch.rs:9:31
50+
--> $DIR/ufcs-qpath-self-mismatch.rs:10:31
3851
|
3952
LL | <i32 as Add<i32>>::add(1, 2u32);
4053
| ---------------------- ^^^^ expected `i32`, found `u32`
4154
| |
4255
| arguments to this function are incorrect
4356
|
4457
help: the return type of this call is `u32` due to the type of the argument passed
45-
--> $DIR/ufcs-qpath-self-mismatch.rs:9:5
58+
--> $DIR/ufcs-qpath-self-mismatch.rs:10:5
4659
|
4760
LL | <i32 as Add<i32>>::add(1, 2u32);
4861
| ^^^^^^^^^^^^^^^^^^^^^^^^^^----^
@@ -68,7 +81,7 @@ LL | <i32 as Add<u32>>::add(1, 2);
6881
<&'a i32 as Add<i32>>
6982
<&i32 as Add<&i32>>
7083

71-
error: aborting due to 4 previous errors
84+
error: aborting due to 5 previous errors
7285

7386
Some errors have detailed explanations: E0277, E0308.
7487
For more information about an error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)