Glue: don't derive Ord or Hash impls for floats

This commit is contained in:
Richard Feldman 2022-08-05 09:44:47 -04:00
parent 26ee1a01bc
commit 72ca577b54
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798

View file

@ -931,7 +931,7 @@ pub struct {name} {{
}
// The Ord impl for the tag union
{
if !has_float(typ, types) {
let opt_impl = Some(format!("impl Ord for {name}"));
let mut buf = r#"fn cmp(&self, other: &Self) -> core::cmp::Ordering {
match self.discriminant().cmp(&other.discriminant()) {
@ -1041,7 +1041,7 @@ pub struct {name} {{
}
// The Hash impl for the tag union
{
if !has_float(typ, types) {
let opt_impl = Some(format!("impl core::hash::Hash for {name}"));
let mut buf = r#"fn hash<H: core::hash::Hasher>(&self, state: &mut H) {"#.to_string();