Enum clippy_utils::ty::type_certainty::certainty::Certainty
source · pub enum Certainty {
Uncertain,
Certain(Option<DefId>),
Contradiction,
}
Variants§
Uncertain
Determining the type requires contextual information.
Certain(Option<DefId>)
The type can be determined purely from subexpressions. If the argument is Some(..)
, the
specific DefId
is known. Such arguments are needed to handle path segments whose res
is
Res::Err
.
Contradiction
The heuristic believes that more than one DefId
applies to a type—this is a bug.
Implementations§
source§impl Certainty
impl Certainty
sourcepub fn join(self, other: Self) -> Self
pub fn join(self, other: Self) -> Self
Join two Certainty
s preserving their DefId
s (if any). Generally speaking, this method
should be used only when self
and other
refer directly to types. Otherwise,
join_clearing_def_ids
should be used.
sourcepub fn join_clearing_def_ids(self, other: Self) -> Self
pub fn join_clearing_def_ids(self, other: Self) -> Self
Join two Certainty
s after clearing their DefId
s. This method should be used when self
or other
do not necessarily refer to types, e.g., when they are aggregations of other
Certainty
s.
pub fn clear_def_id(self) -> Certainty
pub fn with_def_id(self, def_id: DefId) -> Certainty
pub fn to_def_id(self) -> Option<DefId>
pub fn is_certain(self) -> bool
Trait Implementations§
impl Copy for Certainty
impl Eq for Certainty
impl StructuralPartialEq for Certainty
Auto Trait Implementations§
impl Freeze for Certainty
impl RefUnwindSafe for Certainty
impl Send for Certainty
impl Sync for Certainty
impl Unpin for Certainty
impl UnwindSafe for Certainty
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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 moreLayout§
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
Size for each variant:
Uncertain
: 0 bytesCertain
: 8 bytesContradiction
: 0 bytes