if let
This commit is contained in:
parent
ec8cc029c1
commit
41f89beb3f
@ -151,11 +151,9 @@ impl<'tcx> Stack {
|
|||||||
/// Returns the index of the item we matched, `None` if it was the frozen one.
|
/// Returns the index of the item we matched, `None` if it was the frozen one.
|
||||||
/// `kind` indicates which kind of reference is being dereferenced.
|
/// `kind` indicates which kind of reference is being dereferenced.
|
||||||
fn deref(&self, bor: Borrow, kind: RefKind) -> Result<Option<usize>, String> {
|
fn deref(&self, bor: Borrow, kind: RefKind) -> Result<Option<usize>, String> {
|
||||||
// Exclude unique ref and frozen tag.
|
// Exclude unique ref with frozen tag.
|
||||||
match (kind, bor) {
|
if let (RefKind::Unique, Borrow::Shr(Some(_))) = (kind, bor) {
|
||||||
(RefKind::Unique, Borrow::Shr(Some(_))) =>
|
return Err(format!("Encountered mutable reference with frozen tag"));
|
||||||
return Err(format!("Encountered mutable reference with frozen tag")),
|
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
// Checks related to freezing
|
// Checks related to freezing
|
||||||
match bor {
|
match bor {
|
||||||
|
Loading…
Reference in New Issue
Block a user