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
/// **Note** that this method is not safe if you cache the _JsCompilation_ on the Node side, as it will be invalidated by the next build and accessing a dangling ptr is a UB.
let handle_last_compilation = |compiler:&mutPin<Box<rspack_core::Compiler<_>>>| {
252
256
// Safety: compiler is stored in a global hashmap, and compilation is only available in the callback of this function, so it is safe to cast to a static lifetime. See more in the warning part of this method.
253
-
let compiler:&'staticmut rspack_core::Compiler<AsyncNodeWritableFileSystem> =
257
+
// The reason why use Box<Compiler> here instead of Compiler itself is that:
258
+
// Compilers may expand and change its layout underneath, make Compiler layout change.
259
+
// Use Box to make sure the Compiler layout won't change
260
+
let compiler:&'staticmutPin<Box<rspack_core::Compiler<AsyncNodeWritableFileSystem>>> =
0 commit comments