mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Add new type-mismatch diagnostic
This commit is contained in:
parent
2d30dd67d3
commit
ab3313b1cb
7 changed files with 151 additions and 81 deletions
|
@ -38,6 +38,22 @@ impl Mutability {
|
|||
Mutability::Mut => "mut ",
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns `true` if the mutability is [`Mut`].
|
||||
///
|
||||
/// [`Mut`]: Mutability::Mut
|
||||
#[must_use]
|
||||
pub fn is_mut(&self) -> bool {
|
||||
matches!(self, Self::Mut)
|
||||
}
|
||||
|
||||
/// Returns `true` if the mutability is [`Shared`].
|
||||
///
|
||||
/// [`Shared`]: Mutability::Shared
|
||||
#[must_use]
|
||||
pub fn is_shared(&self) -> bool {
|
||||
matches!(self, Self::Shared)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue