Skip to content

Commit

Permalink
fix ui tests
Browse files Browse the repository at this point in the history
these ui changes are closer to what was there before const_trait_impl changes.
  • Loading branch information
fee1-dead committed Jan 27, 2024
1 parent b80d44e commit 2e1e574
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
4 changes: 4 additions & 0 deletions tests/ui/suggestions/invalid-bin-op.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ help: consider annotating `S<T>` with `#[derive(PartialEq)]`
LL + #[derive(PartialEq)]
LL | struct S<T>(T);
|
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
LL | pub fn foo<T>(s: S<T>, t: S<T>) where S<T>: PartialEq {
| +++++++++++++++++++++

error: aborting due to 1 previous error

Expand Down
1 change: 1 addition & 0 deletions tests/ui/ufcs/ufcs-qpath-self-mismatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ fn main() {
<i32 as Add<u32>>::add(1, 2);
//~^ ERROR cannot add `u32` to `i32`
//~| ERROR cannot add `u32` to `i32`
//~| ERROR cannot add `u32` to `i32`
<i32 as Add<i32>>::add(1u32, 2);
//~^ ERROR mismatched types
<i32 as Add<i32>>::add(1, 2u32);
Expand Down
23 changes: 18 additions & 5 deletions tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,29 @@ LL | <i32 as Add<u32>>::add(1, 2);
<&'a i32 as Add<i32>>
<&i32 as Add<&i32>>

error[E0277]: cannot add `u32` to `i32`
--> $DIR/ufcs-qpath-self-mismatch.rs:4:5
|
LL | <i32 as Add<u32>>::add(1, 2);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32`
|
= help: the trait `Add<u32>` is not implemented for `i32`
= help: the following other types implement trait `Add<Rhs>`:
<i32 as Add>
<i32 as Add<&i32>>
<&'a i32 as Add<i32>>
<&i32 as Add<&i32>>

error[E0308]: mismatched types
--> $DIR/ufcs-qpath-self-mismatch.rs:7:28
--> $DIR/ufcs-qpath-self-mismatch.rs:8:28
|
LL | <i32 as Add<i32>>::add(1u32, 2);
| ---------------------- ^^^^ expected `i32`, found `u32`
| |
| arguments to this function are incorrect
|
help: the return type of this call is `u32` due to the type of the argument passed
--> $DIR/ufcs-qpath-self-mismatch.rs:7:5
--> $DIR/ufcs-qpath-self-mismatch.rs:8:5
|
LL | <i32 as Add<i32>>::add(1u32, 2);
| ^^^^^^^^^^^^^^^^^^^^^^^----^^^^
Expand All @@ -34,15 +47,15 @@ LL | <i32 as Add<i32>>::add(1i32, 2);
| ~~~

error[E0308]: mismatched types
--> $DIR/ufcs-qpath-self-mismatch.rs:9:31
--> $DIR/ufcs-qpath-self-mismatch.rs:10:31
|
LL | <i32 as Add<i32>>::add(1, 2u32);
| ---------------------- ^^^^ expected `i32`, found `u32`
| |
| arguments to this function are incorrect
|
help: the return type of this call is `u32` due to the type of the argument passed
--> $DIR/ufcs-qpath-self-mismatch.rs:9:5
--> $DIR/ufcs-qpath-self-mismatch.rs:10:5
|
LL | <i32 as Add<i32>>::add(1, 2u32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^----^
Expand All @@ -68,7 +81,7 @@ LL | <i32 as Add<u32>>::add(1, 2);
<&'a i32 as Add<i32>>
<&i32 as Add<&i32>>

error: aborting due to 4 previous errors
error: aborting due to 5 previous errors

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

0 comments on commit 2e1e574

Please sign in to comment.