Skip to content

Commit aa641bd

Browse files
author
The Miri Conjob Bot
committed
Merge from rustc
2 parents 52f6ccf + 5fdce67 commit aa641bd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/borrow_tracker/stacked_borrows/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,9 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
830830
let new_prov = this.sb_reborrow(place, size, new_perm, new_tag, info)?;
831831

832832
// Adjust place.
833-
Ok(place.clone().map_provenance(|_| new_prov))
833+
// (If the closure gets called, that means the old provenance was `Some`, and hence the new
834+
// one must also be `Some`.)
835+
Ok(place.clone().map_provenance(|_| new_prov.unwrap()))
834836
}
835837

836838
/// Retags an individual pointer, returning the retagged version.

src/borrow_tracker/tree_borrows/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,9 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
351351
let new_prov = this.tb_reborrow(place, reborrow_size, new_perm, new_tag)?;
352352

353353
// Adjust place.
354-
Ok(place.clone().map_provenance(|_| new_prov))
354+
// (If the closure gets called, that means the old provenance was `Some`, and hence the new
355+
// one must also be `Some`.)
356+
Ok(place.clone().map_provenance(|_| new_prov.unwrap()))
355357
}
356358

357359
/// Retags an individual pointer, returning the retagged version.

0 commit comments

Comments
 (0)