From 924624f810bd70078074c62ea94061927d2516bd Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 16 Apr 2019 23:37:37 +0200 Subject: [PATCH] some failures are impossible --- src/stacked_borrows.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stacked_borrows.rs b/src/stacked_borrows.rs index 40cbf92e965..152171aed06 100644 --- a/src/stacked_borrows.rs +++ b/src/stacked_borrows.rs @@ -473,7 +473,7 @@ fn reborrow( "no item to reborrow as {} from tag {} found in borrow stack", new_kind, derived_from, )))?; // With this we can compute the permission for the new pointer. - let new_perm = new_kind.new_perm(derived_from_perm)?; + let new_perm = new_kind.new_perm(derived_from_perm).expect("this should never fail"); // We behave very differently for the "unsafe" case of a shared-read-write pointer // ("unsafe" because this also applies to shared references with interior mutability). -- 2.44.0