pub(crate) type NameBinding<'ra> = Interned<'ra, NameBindingData<'ra>>;
Expand description
All name bindings are unique and allocated on a same arena, so we can use referential equality to compare them.
Aliased Type§
struct NameBinding<'ra>(pub &'ra NameBindingData<'ra>, pub PrivateZst);
Fields§
§0: &'ra NameBindingData<'ra>
§1: PrivateZst
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes
Implementations
Source§impl<'a, T> Interned<'a, T>
impl<'a, T> Interned<'a, T>
Sourcepub const fn new_unchecked(t: &'a T) -> Interned<'a, T>
pub const fn new_unchecked(t: &'a T) -> Interned<'a, T>
Create a new Interned
value. The value referred to must be interned
and thus be unique, and it must remain unique in the future. This
function has _unchecked
in the name but is not unsafe
, because if
the uniqueness condition is violated condition it will cause incorrect
behaviour but will not affect memory safety.
Trait Implementations
Source§impl<T, CTX> HashStable<CTX> for Interned<'_, T>where
T: HashStable<CTX>,
impl<T, CTX> HashStable<CTX> for Interned<'_, T>where
T: HashStable<CTX>,
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher<SipHasher128>)
Source§impl<'a, T> Ord for Interned<'a, T>where
T: Ord,
impl<'a, T> Ord for Interned<'a, T>where
T: Ord,
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more