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 Certaintys preserving their DefIds (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 Certaintys after clearing their DefIds. This method should be used when self
or other do not necessarily refer to types, e.g., when they are aggregations of other
Certaintys.
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§
source§impl PartialEq for Certainty
impl PartialEq for Certainty
impl Copy for Certainty
impl Eq for Certainty
impl StructuralEq for Certainty
impl StructuralPartialEq for Certainty
Auto Trait Implementations§
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
§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.Layout§
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