Skip to content

Commit 70dd9ca

Browse files
committed
Add test for #34229
1 parent 5a52983 commit 70dd9ca

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/test/ui/issues/issue-34229.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#[derive(PartialEq)] struct Comparable;
2+
#[derive(PartialEq, PartialOrd)] struct Nope(Comparable);
3+
4+
fn main() {}

src/test/ui/issues/issue-34229.stderr

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0277]: can't compare `Comparable` with `Comparable`
2+
--> $DIR/issue-34229.rs:2:46
3+
|
4+
LL | #[derive(PartialEq, PartialOrd)] struct Nope(Comparable);
5+
| ^^^^^^^^^^ no implementation for `Comparable < Comparable` and `Comparable > Comparable`
6+
|
7+
= help: the trait `std::cmp::PartialOrd` is not implemented for `Comparable`
8+
= note: required by `std::cmp::PartialOrd::partial_cmp`
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)