mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-28 01:41:05 +00:00
Allow mutating signature through ExternFn
This commit is contained in:
parent
0b956da64a
commit
9bfbea37c7
@ -1,7 +1,7 @@
|
||||
use crate::syntax::{ExternFn, Receiver, Ref, Signature, Slice, Ty1, Type};
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::mem;
|
||||
use std::ops::Deref;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
|
||||
impl Deref for ExternFn {
|
||||
type Target = Signature;
|
||||
@ -11,6 +11,12 @@ impl Deref for ExternFn {
|
||||
}
|
||||
}
|
||||
|
||||
impl DerefMut for ExternFn {
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.sig
|
||||
}
|
||||
}
|
||||
|
||||
impl Hash for Type {
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
mem::discriminant(self).hash(state);
|
||||
|
Loading…
Reference in New Issue
Block a user