mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
Glue: don't derive Ord or Hash impls for floats
This commit is contained in:
parent
26ee1a01bc
commit
72ca577b54
1 changed files with 2 additions and 2 deletions
|
@ -931,7 +931,7 @@ pub struct {name} {{
|
||||||
}
|
}
|
||||||
|
|
||||||
// The Ord impl for the tag union
|
// The Ord impl for the tag union
|
||||||
{
|
if !has_float(typ, types) {
|
||||||
let opt_impl = Some(format!("impl Ord for {name}"));
|
let opt_impl = Some(format!("impl Ord for {name}"));
|
||||||
let mut buf = r#"fn cmp(&self, other: &Self) -> core::cmp::Ordering {
|
let mut buf = r#"fn cmp(&self, other: &Self) -> core::cmp::Ordering {
|
||||||
match self.discriminant().cmp(&other.discriminant()) {
|
match self.discriminant().cmp(&other.discriminant()) {
|
||||||
|
@ -1041,7 +1041,7 @@ pub struct {name} {{
|
||||||
}
|
}
|
||||||
|
|
||||||
// The Hash impl for the tag union
|
// The Hash impl for the tag union
|
||||||
{
|
if !has_float(typ, types) {
|
||||||
let opt_impl = Some(format!("impl core::hash::Hash for {name}"));
|
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();
|
let mut buf = r#"fn hash<H: core::hash::Hasher>(&self, state: &mut H) {"#.to_string();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue