Fixed aliasing issue due to RacyCell implementation

This commit is contained in:
Emil Fresk 2021-11-02 13:41:12 +01:00
parent b25d775771
commit 8065d741ac
10 changed files with 47 additions and 49 deletions

View file

@ -57,9 +57,9 @@ pub fn codegen(ctxt: Context, needs_lt: &mut bool, app: &App) -> (TokenStream2,
let expr = if is_declared {
// If the local resources is already initialized, we only need to access its value and
// not go through an `MaybeUninit`
quote!(#mangled_name.get_mut_unchecked())
quote!(&mut *#mangled_name.get_mut())
} else {
quote!(&mut *#mangled_name.get_mut_unchecked().as_mut_ptr())
quote!(&mut *(&mut *#mangled_name.get_mut()).as_mut_ptr())
};
values.push(quote!(