Struct rustc::ty::sty::DebruijnIndex [−]
pub struct DebruijnIndex(u32);
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Methods
impl DebruijnIndex
[src]
impl DebruijnIndex
#[must_use]
pub const fn shifted_in(self, amount: u32) -> DebruijnIndex
[src]
#[must_use]
pub const fn shifted_in(self, amount: u32) -> DebruijnIndex
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Returns the resulting index when this value is moved into
amount
number of new binders. So e.g. if you had
for<'a> fn(&'a x)
and you wanted to change to
for<'a> fn(for<'b> fn(&'a x))
you would need to shift the index for 'a
into 1 new binder.
pub fn shift_in(&mut self, amount: u32)
[src]
pub fn shift_in(&mut self, amount: u32)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Update this index in place by shifting it "in" through
amount
number of binders.
#[must_use]
pub const fn shifted_out(self, amount: u32) -> DebruijnIndex
[src]
#[must_use]
pub const fn shifted_out(self, amount: u32) -> DebruijnIndex
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Returns the resulting index when this value is moved out from
amount
number of new binders.
pub fn shift_out(&mut self, amount: u32)
[src]
pub fn shift_out(&mut self, amount: u32)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Update in place by shifting out from amount
binders.
pub fn shifted_out_to_binder(self, to_binder: DebruijnIndex) -> Self
[src]
pub fn shifted_out_to_binder(self, to_binder: DebruijnIndex) -> Self
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Adjusts any Debruijn Indices so as to make to_binder
the
innermost binder. That is, if we have something bound at to_binder
,
it will now be bound at INNERMOST. This is an appropriate thing to do
when moving a region out from inside binders:
for<'a> fn(for<'b> for<'c> fn(&'a u32), _) // Binder: D3 D2 D1 ^^
Here, the region 'a
would have the debruijn index D3,
because it is the bound 3 binders out. However, if we wanted
to refer to that region 'a
in the second argument (the _
),
those two binders would not be in scope. In that case, we
might invoke shift_out_to_binder(D3)
. This would adjust the
debruijn index of 'a
to D1 (the innermost binder).
If we invoke shift_out_to_binder
and the region is in fact
bound by one of the binders we are shifting out of, that is an
error (and should fail an assertion failure).
Trait Implementations
impl Copy for DebruijnIndex
impl Copy for DebruijnIndex
impl Clone for DebruijnIndex
impl Clone for DebruijnIndex
fn clone(&self) -> DebruijnIndex
fn clone(&self) -> DebruijnIndex
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for DebruijnIndex
impl PartialEq for DebruijnIndex
fn eq(&self, other: &DebruijnIndex) -> bool
fn eq(&self, other: &DebruijnIndex) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &DebruijnIndex) -> bool
fn ne(&self, other: &DebruijnIndex) -> bool
This method tests for !=
.
impl Eq for DebruijnIndex
impl Eq for DebruijnIndex
fn assert_receiver_is_total_eq(&self)
fn assert_receiver_is_total_eq(&self)
impl Hash for DebruijnIndex
impl Hash for DebruijnIndex
fn hash<__H: Hasher>(&self, state: &mut __H)
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialOrd for DebruijnIndex
impl PartialOrd for DebruijnIndex
fn partial_cmp(&self, other: &DebruijnIndex) -> Option<Ordering>
fn partial_cmp(&self, other: &DebruijnIndex) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &DebruijnIndex) -> bool
fn lt(&self, other: &DebruijnIndex) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &DebruijnIndex) -> bool
fn le(&self, other: &DebruijnIndex) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &DebruijnIndex) -> bool
fn gt(&self, other: &DebruijnIndex) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &DebruijnIndex) -> bool
fn ge(&self, other: &DebruijnIndex) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for DebruijnIndex
impl Ord for DebruijnIndex
fn cmp(&self, other: &DebruijnIndex) -> Ordering
fn cmp(&self, other: &DebruijnIndex) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Decodable for DebruijnIndex
impl Decodable for DebruijnIndex
fn decode<__D: Decoder>(d: &mut __D) -> Result<DebruijnIndex, __D::Error>
fn decode<__D: Decoder>(d: &mut __D) -> Result<DebruijnIndex, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl Encodable for DebruijnIndex
impl Encodable for DebruijnIndex
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl Idx for DebruijnIndex
impl Idx for DebruijnIndex
fn new(value: usize) -> Self
fn new(value: usize) -> Self
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn index(self) -> usize
fn index(self) -> usize
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn increment_by(&mut self, amount: usize)
[src]
fn increment_by(&mut self, amount: usize)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl Step for DebruijnIndex
impl Step for DebruijnIndex
fn steps_between(start: &Self, end: &Self) -> Option<usize>
fn steps_between(start: &Self, end: &Self) -> Option<usize>
🔬 This is a nightly-only experimental API. (step_trait
)
likely to be replaced by finer-grained traits
Returns the number of steps between two step objects. The count is inclusive of start
and exclusive of end
. Read more
fn replace_one(&mut self) -> Self
fn replace_one(&mut self) -> Self
🔬 This is a nightly-only experimental API. (step_trait
)
likely to be replaced by finer-grained traits
Replaces this step with 1
, returning itself
fn replace_zero(&mut self) -> Self
fn replace_zero(&mut self) -> Self
🔬 This is a nightly-only experimental API. (step_trait
)
likely to be replaced by finer-grained traits
Replaces this step with 0
, returning itself
fn add_one(&self) -> Self
fn add_one(&self) -> Self
🔬 This is a nightly-only experimental API. (step_trait
)
likely to be replaced by finer-grained traits
Adds one to this step, returning the result
fn sub_one(&self) -> Self
fn sub_one(&self) -> Self
🔬 This is a nightly-only experimental API. (step_trait
)
likely to be replaced by finer-grained traits
Subtracts one to this step, returning the result
fn add_usize(&self, u: usize) -> Option<Self>
fn add_usize(&self, u: usize) -> Option<Self>
🔬 This is a nightly-only experimental API. (step_trait
)
likely to be replaced by finer-grained traits
Add an usize, returning None on overflow
impl Debug for DebruijnIndex
impl Debug for DebruijnIndex
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for DebruijnIndex
[src]
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for DebruijnIndex
fn hash_stable<W: StableHasherResult>(
&self,
__ctx: &mut StableHashingContext<'a>,
__hasher: &mut StableHasher<W>
)
[src]
fn hash_stable<W: StableHasherResult>(
&self,
__ctx: &mut StableHashingContext<'a>,
__hasher: &mut StableHasher<W>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Auto Trait Implementations
impl Send for DebruijnIndex
impl Send for DebruijnIndex
impl Sync for DebruijnIndex
impl Sync for DebruijnIndex