Skip to content

Commit cc72618

Browse files
committed
Fix type inference failures in PartialOrd/Ord impls
1 parent bc05181 commit cc72618

3 files changed

Lines changed: 50 additions & 287 deletions

File tree

src/trait_handlers/ord/ord_enum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl TraitHandler for OrdEnumHandler {
210210
} else {
211211
let discriminant_cmp = quote! {
212212
unsafe {
213-
::core::cmp::Ord::cmp(&*<*const _>::from(self).cast::<#discriminant_type>(), &*<*const _>::from(other).cast::<#discriminant_type>())
213+
::core::cmp::Ord::cmp(&*<*const Self>::from(self).cast::<#discriminant_type>(), &*<*const Self>::from(other).cast::<#discriminant_type>())
214214
}
215215
};
216216

src/trait_handlers/partial_ord/partial_ord_enum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ impl TraitHandler for PartialOrdEnumHandler {
215215
} else {
216216
let discriminant_cmp = quote! {
217217
unsafe {
218-
::core::cmp::Ord::cmp(&*<*const _>::from(self).cast::<#discriminant_type>(), &*<*const _>::from(other).cast::<#discriminant_type>())
218+
::core::cmp::Ord::cmp(&*<*const Self>::from(self).cast::<#discriminant_type>(), &*<*const Self>::from(other).cast::<#discriminant_type>())
219219
}
220220
};
221221

0 commit comments

Comments
 (0)