pub enum DefectClass {
Show 14 variants
CleanupGap,
ContractDrift,
ErrorTextDrift,
FalseCompileClaim,
LintConvention,
LossyIdentity,
MissingEvent,
OrderingBug,
PerfContract,
PermissiveConstraint,
ProseClarity,
SilentTruncation,
UxDiagnostic,
VacuousTest,
}Expand description
The kind of defect a comment asserted.
The vocabulary is closed: adding a variant means the corpus README’s class
table gains a row, and review_corpus.rs’s table check holds the two together.
Variants are named for what goes wrong, not for the subsystem it happens in,
because the useful question a score answers is “which kinds of defect can
this reviewer see?”.
Variants§
CleanupGap
A guard stops a cleanup path doing its job.
ContractDrift
A doc, comment or ADR contradicts the code it describes.
ErrorTextDrift
An error message does not state the rule it enforces.
FalseCompileClaim
Asserts the code will not build. Every row in this class is a false
positive — see crate::compile_claim, which is the suppression rule
that measurement licenses.
LintConvention
A suppression lacks the justification the house style requires.
LossyIdentity
A key derived from a lossy conversion, so distinct inputs collide.
MissingEvent
An early return skips a documented side effect.
OrderingBug
An aggregate computed after the mutation it must precede.
PerfContract
The implementation defeats a field’s stated design goal.
PermissiveConstraint
A constraint permits the state it exists to forbid.
ProseClarity
Wording only.
SilentTruncation
A read or copy drops a remainder without erroring.
UxDiagnostic
A message tells the user to do the wrong thing.
VacuousTest
A test passes while the behaviour it names is broken.
Implementations§
Source§impl DefectClass
impl DefectClass
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
Stable token as it appears in the corpus file (contract-drift, …).
Written out rather than derived from the serde rename so that a report
does not have to serialise a value to name it;
as_str_matches_the_serialised_form holds the two together.
Sourcepub fn from_token(token: &str) -> Option<Self>
pub fn from_token(token: &str) -> Option<Self>
The class from its corpus token, or None if it names no class.
Trait Implementations§
Source§impl Clone for DefectClass
impl Clone for DefectClass
Source§fn clone(&self) -> DefectClass
fn clone(&self) -> DefectClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DefectClass
Source§impl Debug for DefectClass
impl Debug for DefectClass
Source§impl<'de> Deserialize<'de> for DefectClass
impl<'de> Deserialize<'de> for DefectClass
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for DefectClass
impl Display for DefectClass
impl Eq for DefectClass
Source§impl Hash for DefectClass
impl Hash for DefectClass
Source§impl Ord for DefectClass
impl Ord for DefectClass
Source§fn cmp(&self, other: &DefectClass) -> Ordering
fn cmp(&self, other: &DefectClass) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for DefectClass
impl PartialEq for DefectClass
Source§impl PartialOrd for DefectClass
impl PartialOrd for DefectClass
Source§impl Serialize for DefectClass
impl Serialize for DefectClass
impl StructuralPartialEq for DefectClass
Auto Trait Implementations§
impl Freeze for DefectClass
impl RefUnwindSafe for DefectClass
impl Send for DefectClass
impl Sync for DefectClass
impl Unpin for DefectClass
impl UnsafeUnpin for DefectClass
impl UnwindSafe for DefectClass
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.