-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #111516 - compiler-errors:issue-111500, r=jackh726
Don't use `can_eq` in `derive(..)` suggestion for missing method Unsatisfied predicates returned from method probe may reference inference vars from that probe, so drop this extra check I added in #110877 for more accurate derive suggestions... Fixes #111500
- Loading branch information
Showing
4 changed files
with
44 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
pub struct A; | ||
|
||
fn main() { | ||
match () { | ||
_ => match A::partial_cmp() {}, | ||
//~^ ERROR the function or associated item `partial_cmp` exists for struct `A`, but its trait bounds were not satisfied | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
error[E0599]: the function or associated item `partial_cmp` exists for struct `A`, but its trait bounds were not satisfied | ||
--> $DIR/derive-sugg-arg-arity.rs:5:23 | ||
| | ||
LL | pub struct A; | ||
| ------------ | ||
| | | ||
| function or associated item `partial_cmp` not found for this struct | ||
| doesn't satisfy `A: Iterator` | ||
| doesn't satisfy `A: PartialOrd<_>` | ||
... | ||
LL | _ => match A::partial_cmp() {}, | ||
| ^^^^^^^^^^^ function or associated item cannot be called on `A` due to unsatisfied trait bounds | ||
| | ||
= note: the following trait bounds were not satisfied: | ||
`A: PartialOrd<_>` | ||
which is required by `&A: PartialOrd<&_>` | ||
`A: PartialOrd<_>` | ||
which is required by `&mut A: PartialOrd<&mut _>` | ||
`A: Iterator` | ||
which is required by `&mut A: Iterator` | ||
note: the trait `Iterator` must be implemented | ||
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL | ||
help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]` | ||
| | ||
LL + #[derive(PartialEq, PartialOrd)] | ||
LL | pub struct A; | ||
| | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0599`. |