Stub out FnAbi::partial_eq as a workaround for now

This commit is contained in:
Lukas Wirth 2024-01-19 15:13:23 +01:00
parent 3a722bdf2e
commit 46e38318a2
4 changed files with 26 additions and 10 deletions

View file

@ -356,7 +356,7 @@ pub struct CallableSig {
has_interner!(CallableSig);
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[derive(Debug, Copy, Clone, Eq)]
pub enum FnAbi {
Aapcs,
AapcsUnwind,
@ -398,6 +398,21 @@ pub enum FnAbi {
Unknown,
}
impl PartialEq for FnAbi {
fn eq(&self, _other: &Self) -> bool {
// FIXME: Proper equality breaks `coercion::two_closures_lub` test
true
}
}
impl Hash for FnAbi {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
// Required because of the FIXME above and due to us implementing `Eq`, without this
// we would break the `Hash` + `Eq` contract
core::mem::discriminant(&Self::Unknown).hash(state);
}
}
impl FnAbi {
pub fn from_str(s: &str) -> FnAbi {
match s {