-
-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously, PartialEq was enough for a derivation of PostgresEq. However, the way that we already annotate these operators implies heavy usage of an assumption that there is an absolute equality. Partially-ordered sets need not apply.
- Loading branch information
1 parent
fd497c1
commit 521e0a6
Showing
5 changed files
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
use pgrx::prelude::*; | ||
|
||
#[derive(PartialEq, PostgresEq)] | ||
struct BrokenType { | ||
int: i32, | ||
} | ||
|
||
fn main() {} |
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,16 @@ | ||
error[E0277]: the trait bound `BrokenType: std::cmp::Eq` is not satisfied | ||
--> tests/ui/total_eq_for_postgres_eq.rs:4:8 | ||
| | ||
4 | struct BrokenType { | ||
| ^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `BrokenType` | ||
| | ||
note: required by a bound in `PostgresEqRequiresTotalEq` | ||
--> $WORKSPACE/pgrx/src/deriving.rs | ||
| | ||
| pub trait PostgresEqRequiresTotalEq: Eq {} | ||
| ^^ required by this bound in `PostgresEqRequiresTotalEq` | ||
help: consider annotating `BrokenType` with `#[derive(Eq)]` | ||
| | ||
4 + #[derive(Eq)] | ||
5 | struct BrokenType { | ||
| |
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,3 @@ | ||
#![doc(hidden)] | ||
|
||
pub trait PostgresEqRequiresTotalEq: Eq {} |
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