mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Stub out FnAbi::partial_eq as a workaround for now
This commit is contained in:
parent
3a722bdf2e
commit
46e38318a2
4 changed files with 26 additions and 10 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue