You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This one is fun, because `SpanCalculator` holds a reference to the
file's source code, while the `mlua::UserData` works best for Rust types
that are 'static.
To get around this, we make sure to only ever create `SpanCalculator`
wrappers for source data that is owned by the Lua interpreter, and add
that source data as a user value of the Lua wrapper that we create.
That should cause Lua's garbage collector to ensure that the source code
outlives the `SpanCalculator`, making it safe for us to transmute the
source reference to a 'static lifetime.
0 commit comments