Harden the pre-tyctxt query system against accidental recomputation
This commit is contained in:
parent
b22c152958
commit
58782a8842
7 changed files with 78 additions and 63 deletions
|
@ -40,6 +40,11 @@ impl<T> Steal<T> {
|
|||
ReadGuard::map(borrow, |opt| opt.as_ref().unwrap())
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn get_mut(&mut self) -> &mut T {
|
||||
self.value.get_mut().as_mut().expect("attempt to read from stolen value")
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn steal(&self) -> T {
|
||||
let value_ref = &mut *self.value.try_write().expect("stealing value which is locked");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue