[−][src]Struct rustc_data_structures::transitive_relation::TransitiveRelation
🔬 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?
Fields
elements: Vec<T>
🔬 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?
map: FxHashMap<T, Index>
🔬 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?
edges: Vec<Edge>
🔬 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?
closure: Lock<Option<BitMatrix<usize, 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?
Methods
impl<T: Clone + Debug + Eq + Hash> TransitiveRelation<T>
[src]
impl<T: Clone + Debug + Eq + Hash> TransitiveRelation<T>
pub fn new() -> TransitiveRelation<T>
[src]
pub fn new() -> TransitiveRelation<T>
🔬 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?
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
🔬 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, a: &T) -> Option<Index>
[src]
fn index(&self, a: &T) -> Option<Index>
🔬 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 add_index(&mut self, a: T) -> Index
[src]
fn add_index(&mut self, a: T) -> Index
🔬 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?
pub fn maybe_map<F, U>(&self, f: F) -> Option<TransitiveRelation<U>> where
F: FnMut(&T) -> Option<U>,
U: Clone + Debug + Eq + Hash + Clone,
[src]
pub fn maybe_map<F, U>(&self, f: F) -> Option<TransitiveRelation<U>> where
F: FnMut(&T) -> Option<U>,
U: Clone + Debug + Eq + Hash + Clone,
🔬 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?
Applies the (partial) function to each edge and returns a new
relation. If f
returns None
for any end-point, returns
None
.
pub fn add(&mut self, a: T, b: T)
[src]
pub fn add(&mut self, a: T, b: T)
🔬 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?
Indicate that a < b
(where <
is this relation)
pub fn contains(&self, a: &T, b: &T) -> bool
[src]
pub fn contains(&self, a: &T, b: &T) -> bool
🔬 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?
Check whether a < target
(transitively)
pub fn reachable_from(&self, a: &T) -> Vec<&T>
[src]
pub fn reachable_from(&self, a: &T) -> Vec<&T>
🔬 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?
Thinking of x R y
as an edge x -> y
in a graph, this
returns all things reachable from a
.
Really this probably ought to be impl Iterator<Item=&T>
, but
I'm too lazy to make that work, and -- given the caching
strategy -- it'd be a touch tricky anyhow.
pub fn postdom_upper_bound(&self, a: &T, b: &T) -> Option<&T>
[src]
pub fn postdom_upper_bound(&self, a: &T, b: &T) -> Option<&T>
🔬 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?
Picks what I am referring to as the "postdominating"
upper-bound for a
and b
. This is usually the least upper
bound, but in cases where there is no single least upper
bound, it is the "mutual immediate postdominator", if you
imagine a graph where a < b
means a -> b
.
This function is needed because region inference currently requires that we produce a single "UB", and there is no best choice for the LUB. Rather than pick arbitrarily, I pick a less good, but predictable choice. This should help ensure that region inference yields predictable results (though it itself is not fully sufficient).
Examples are probably clearer than any prose I could write
(there are corresponding tests below, btw). In each case,
the query is postdom_upper_bound(a, b)
:
// returns Some(x), which is also LUB
a -> a1 -> x
^
|
b -> b1 ---+
// returns Some(x), which is not LUB (there is none)
// diagonal edges run left-to-right
a -> a1 -> x
\/ ^
/\ |
b -> b1 ---+
// returns None
a -> a1
b -> b1
pub fn mutual_immediate_postdominator<'a>(
&'a self,
mubs: Vec<&'a T>
) -> Option<&'a T>
[src]
pub fn mutual_immediate_postdominator<'a>(
&'a self,
mubs: Vec<&'a T>
) -> Option<&'a T>
🔬 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?
Viewing the relation as a graph, computes the "mutual
immediate postdominator" of a set of points (if one
exists). See postdom_upper_bound
for details.
pub fn minimal_upper_bounds(&self, a: &T, b: &T) -> Vec<&T>
[src]
pub fn minimal_upper_bounds(&self, a: &T, b: &T) -> Vec<&T>
🔬 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 set of bounds X
such that:
a < X
andb < X
- there is no
Y != X
such thata < Y
andY < X
- except for the case where
X < a
(i.e., a strongly connected component in the graph). In that case, the smallest representative of the SCC is returned (as determined by the internal indices).
- except for the case where
Note that this set can, in principle, have any size.
pub fn parents(&self, a: &T) -> Vec<&T>
[src]
pub fn parents(&self, a: &T) -> Vec<&T>
🔬 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?
Given an element A, returns the maximal set {B} of elements B such that
- A != B
- A R B is true
- for each i, j: B[i] R B[j] does not hold
The intuition is that this moves "one step up" through a lattice
(where the relation is encoding the <=
relation for the lattice).
So e.g. if the relation is ->
and we have
a -> b -> d -> f | ^ +--> c -> e ---+
then parents(a)
returns [b, c]
. The postdom_parent
function
would further reduce this to just f
.
pub fn postdom_parent(&self, a: &T) -> Option<&T>
[src]
pub fn postdom_parent(&self, a: &T) -> Option<&T>
🔬 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?
A "best" parent in some sense. See parents
and
postdom_upper_bound
for more details.
fn with_closure<OP, R>(&self, op: OP) -> R where
OP: FnOnce(&BitMatrix<usize, usize>) -> R,
[src]
fn with_closure<OP, R>(&self, op: OP) -> R where
OP: FnOnce(&BitMatrix<usize, usize>) -> R,
🔬 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 compute_closure(&self) -> BitMatrix<usize, usize>
[src]
fn compute_closure(&self) -> BitMatrix<usize, 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?
Trait Implementations
impl<T: Clone + Clone + Debug + Eq + Hash> Clone for TransitiveRelation<T>
[src]
impl<T: Clone + Clone + Debug + Eq + Hash> Clone for TransitiveRelation<T>
fn clone(&self) -> TransitiveRelation<T>
[src]
fn clone(&self) -> TransitiveRelation<T>
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<T: Debug + Clone + Debug + Eq + Hash> Debug for TransitiveRelation<T>
[src]
impl<T: Debug + Clone + Debug + Eq + Hash> Debug for TransitiveRelation<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> Encodable for TransitiveRelation<T> where
T: Clone + Encodable + Debug + Eq + Hash + Clone,
[src]
impl<T> Encodable for TransitiveRelation<T> where
T: Clone + Encodable + Debug + Eq + Hash + Clone,
fn encode<E: Encoder>(&self, s: &mut E) -> Result<(), E::Error>
[src]
fn encode<E: Encoder>(&self, s: &mut E) -> Result<(), E::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<T> Decodable for TransitiveRelation<T> where
T: Clone + Decodable + Debug + Eq + Hash + Clone,
[src]
impl<T> Decodable for TransitiveRelation<T> where
T: Clone + Decodable + Debug + Eq + Hash + Clone,
fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error>
[src]
fn decode<D: Decoder>(d: &mut D) -> Result<Self, 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<CTX, T> HashStable<CTX> for TransitiveRelation<T> where
T: HashStable<CTX> + Eq + Debug + Clone + Hash,
[src]
impl<CTX, T> HashStable<CTX> for TransitiveRelation<T> where
T: HashStable<CTX> + Eq + Debug + Clone + Hash,
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut CTX,
hasher: &mut StableHasher<W>
)
[src]
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut CTX,
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<T> Send for TransitiveRelation<T> where
T: Send,
impl<T> Send for TransitiveRelation<T> where
T: Send,
impl<T> !Sync for TransitiveRelation<T>
impl<T> !Sync for TransitiveRelation<T>
Blanket Implementations
impl<T> Erased for T
[src]
impl<T> Erased for T
impl<T> Send for T where
T: ?Sized,
[src]
impl<T> Send for T where
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
impl<T> Sync for T where
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow(&self) -> &T
[src]
fn borrow(&self) -> &T
Immutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> Encodable for T where
T: UseSpecializedEncodable + ?Sized,
[src]
impl<T> Encodable for T where
T: UseSpecializedEncodable + ?Sized,
fn encode<E>(&self, e: &mut E) -> Result<(), <E as Encoder>::Error> where
E: Encoder,
[src]
fn encode<E>(&self, e: &mut E) -> Result<(), <E as Encoder>::Error> where
E: Encoder,
🔬 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<T> Decodable for T where
T: UseSpecializedDecodable,
[src]
impl<T> Decodable for T where
T: UseSpecializedDecodable,
fn decode<D>(d: &mut D) -> Result<T, <D as Decoder>::Error> where
D: Decoder,
[src]
fn decode<D>(d: &mut D) -> Result<T, <D as Decoder>::Error> where
D: Decoder,
🔬 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<E> SpecializationError for E
[src]
impl<E> SpecializationError for E
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized,
[src]
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized,
🔬 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?
Create an error for a missing method specialization. Defaults to panicking with type, trait & method names. S
is the encoder/decoder state type, T
is the type being encoded/decoded, and the arguments are the names of the trait and method that should've been overridden. Read more
impl<T> Erased for T
impl<T> Erased for T