File tree Expand file tree Collapse file tree
crates/wasmi/src/instance Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,8 +97,9 @@ impl AnyHandleAndEntity {
9797 ///
9898 /// # Safety
9999 ///
100- /// The caller must ensure that `self` stores a `T` handle.
101- /// Debug builds validate this against the stored handle kind tag.
100+ /// The caller must ensure that `this` points to a live entry that stores a `T` handle and
101+ /// that is not mutably accessed for the duration of the call.
102+ /// Debug builds validate the handle kind against the stored handle kind tag.
102103 #[ inline]
103104 pub fn into_typed_ptr < T : HasHandleKind > (
104105 this : NonNull < AnyHandleAndEntity > ,
@@ -168,6 +169,11 @@ impl<T: Handle<Entity: Sized>> HandleAndEntity<T> {
168169 /// Maps `this` to the internal pointer to the cached entity of the pointee.
169170 ///
170171 /// The returned pointer is only sound to dereference once the cache has been warmed up.
172+ ///
173+ /// # Safety
174+ ///
175+ /// The caller must ensure that `this` points to a live entry that is not accessed through
176+ /// any other pointer for the duration of the call.
171177 #[ inline]
172178 pub fn map_entity ( this : NonNull < Self > ) -> NonNull < <T as Handle >:: Entity > {
173179 let mut this = this;
You can’t perform that action at this time.
0 commit comments