enum: Unconditionally generate a return statement in partialeq implementations.

This fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1628754#c7
This commit is contained in:
Emilio Cobos Álvarez
2020-04-10 13:02:18 +02:00
parent a519f1bda4
commit 0fed9eebc4
3 changed files with 9 additions and 3 deletions
+5 -1
View File
@@ -946,9 +946,13 @@ impl Source for Enum {
}
}
if !exhaustive {
write!(out, "default: return true;");
write!(out, "default: break;");
}
out.close_brace(false);
out.new_line();
write!(out, "return true;");
out.close_brace(false);
if config.structure.derive_neq(&self.annotations) {
+2 -1
View File
@@ -124,8 +124,9 @@ union C {
#if defined(PLATFORM_UNIX)
case Tag::C5: return c5 == other.c5;
#endif
default: return true;
default: break;
}
return true;
}
bool operator!=(const C& other) const {
+2 -1
View File
@@ -82,8 +82,9 @@ union Bar {
case Tag::Bazz: return bazz == aOther.bazz;
case Tag::FooNamed: return foo_named == aOther.foo_named;
case Tag::FooParen: return foo_paren == aOther.foo_paren;
default: return true;
default: break;
}
return true;
}
bool operator!=(const Bar& aOther) const {