File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,18 @@ pub enum MigrationType {
13
13
ReversibleDown ,
14
14
}
15
15
16
+ // It seems that deriving PartialEq leads to some weird lifetime bug I don't know why:
17
+ //
18
+ // `sqlx-core/src/postgres/copy.rs` then fails to compile with:
19
+ // `associated function was supposed to return data with lifetime `'c` but it is returning data with lifetime `'1``
20
+ //
21
+ // Using a manual implementation seems to work however
22
+ impl PartialEq for MigrationType {
23
+ fn eq ( & self , other : & Self ) -> bool {
24
+ core:: mem:: discriminant ( self ) == core:: mem:: discriminant ( other)
25
+ }
26
+ }
27
+
16
28
impl MigrationType {
17
29
pub fn from_filename ( filename : & str ) -> Self {
18
30
if filename. ends_with ( MigrationType :: ReversibleUp . suffix ( ) ) {
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ async fn same_output() -> anyhow::Result<()> {
12
12
for ( e, r) in EMBEDDED . iter ( ) . zip ( runtime. iter ( ) ) {
13
13
assert_eq ! ( e. version, r. version) ;
14
14
assert_eq ! ( e. description, r. description) ;
15
+ assert_eq ! ( e. migration_type, r. migration_type) ;
15
16
assert_eq ! ( e. sql, r. sql) ;
16
17
assert_eq ! ( e. checksum, r. checksum) ;
17
18
}
You can’t perform that action at this time.
0 commit comments