[core] Add #[track_caller] to Registry lock methods.

This commit is contained in:
Jim Blandy authored and Erich Gubler committed 2024-08-28 22:44:20 -04:00
1 parent f56914cea9
commit 3f6f1d766c
1 file changed
+2
+2
View File
@@ -101,9 +101,11 @@ impl<T: StorageItem> Registry<T> {
pub(crate) fn get(&self, id: Id<T::Marker>) -> Result<Arc<T>, InvalidId> {
self.read().get_owned(id)
}
#[track_caller]
pub(crate) fn read<'a>(&'a self) -> RwLockReadGuard<'a, Storage<T>> {
self.storage.read()
}
#[track_caller]
pub(crate) fn write<'a>(&'a self) -> RwLockWriteGuard<'a, Storage<T>> {
self.storage.write()
}