struct BlocksInfo {
succs: BTreeSet<OrdBlockId>,
best_inter_succs: BTreeSet<OrdBlockId>,
}
Expand description
Information used to compute the switch exits. We compute this information for every block in the graph. Note that we make sure to use immutable sets because we rely a lot on cloning.
Fields§
§succs: BTreeSet<OrdBlockId>
All the successors of the block
best_inter_succs: BTreeSet<OrdBlockId>
The “best” intersection between the successors of the different direct children of the block. We use this to find switch exits candidates: if the intersection is non-empty and because the elements are topologically sorted, the first block in the set should be the exit. Note that we can ignore children when computing the intersection, which is why we call it the “best” intersection. For instance, in the following:
switch i {
0 => x = 1,
1 => x = 2,
_ => panic,
}
The branches 0 and 1 have successors which intersect, but the branch 2 doesn’t because it terminates: we thus ignore it.
Trait Implementations§
source§impl Clone for BlocksInfo
impl Clone for BlocksInfo
source§fn clone(&self) -> BlocksInfo
fn clone(&self) -> BlocksInfo
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for BlocksInfo
impl RefUnwindSafe for BlocksInfo
impl Send for BlocksInfo
impl Sync for BlocksInfo
impl Unpin for BlocksInfo
impl UnwindSafe for BlocksInfo
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original
input to the nom parser, extract more the useful context information. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom,
recreate a context in the original string where the error occurred. Read more