Stream: git-wasmtime

Topic: wasmtime / PR #5855 Have StoreContext::data return &'a T


view this post on Zulip Wasmtime GitHub notifications bot (Feb 22 2023 at 20:52):

coolreader18 opened PR #5855 from data-lifetime to main:

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

I ran into a case where because Memory::data_and_store_mut returns a &'a mut T, I was expecting StoreContext::data to return a &'a T, but that wasn't the case despite it being perfectly sound for it to do so. (was trying to make a data_and_store(impl Into<StoreContext<'a, T>>) -> (&'a [u8], &'a T) convenience function in my project but it failed to compile for the aforementioned reason)

Also added a StoreContext: From<StoreContextMut> impl, which would probably be useful for something in context/data/memory juggling even if I can't think of what specifically off the top of my head.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2023 at 15:32):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2023 at 17:01):

alexcrichton merged PR #5855.


Last updated: Nov 22 2024 at 17:03 UTC