This commit is contained in:
Ralf Jung 2018-11-21 16:01:39 +01:00
parent ec8cc029c1
commit 41f89beb3f

View File

@ -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 {