pub enum Visibility {
Active,
Inactive,
Unknown,
}Expand description
Whether the code inside a guard is being compiled.
Variants§
Active
Every condition holds, so this code is compiled. Code at file scope is always this.
Inactive
Some condition does not hold, so this code is not compiled under the configuration in hand. It stays in the tree and in the index; a consumer greys it out rather than dropping it.
Unknown
At least one condition cannot be decided, and none of the ones that can be decided rules the region out.
Implementations§
Source§impl Visibility
impl Visibility
Sourcepub fn is_reachable(self) -> bool
pub fn is_reachable(self) -> bool
Should a consumer treat this code as reachable?
Active and Unknown both answer yes: code whose visibility is unknown is code that might be
compiled, and hiding it would be the wrong guess. This is the predicate completion should use.
Sourcepub fn is_diagnosable(self) -> bool
pub fn is_diagnosable(self) -> bool
Should a consumer report diagnostics inside this code?
Only Active. Reporting an error in a branch that is not compiled is a false positive, and an
editor-facing tool that reports false positives gets switched off.
Trait Implementations§
Source§impl Clone for Visibility
impl Clone for Visibility
impl Copy for Visibility
Source§impl Debug for Visibility
impl Debug for Visibility
impl Eq for Visibility
Source§impl PartialEq for Visibility
impl PartialEq for Visibility
impl StructuralPartialEq for Visibility
Auto Trait Implementations§
impl Forget for Visibility
impl Freeze for Visibility
impl RefUnwindSafe for Visibility
impl Send for Visibility
impl Sync for Visibility
impl Unpin for Visibility
impl UnsafeUnpin for Visibility
impl UnwindSafe for Visibility
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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