Skip to content

Commit

Permalink
Merge pull request #1517 from felinira/wip/addr-of-mut
Browse files Browse the repository at this point in the history
glib-macros: Remove &mut to static mut in object_subclass
  • Loading branch information
sdroege authored Sep 24, 2024
2 parents b97554d + e7218d4 commit 8052e13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion glib-macros/src/object_impl_attributes/subclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub fn impl_object_subclass(input: super::Input) -> TokenStream {
fn type_data() -> ::std::ptr::NonNull<#crate_ident::subclass::TypeData> {
static mut DATA: #crate_ident::subclass::TypeData =
#crate_ident::subclass::types::TypeData::new();
unsafe { ::std::ptr::NonNull::from(&mut DATA) }
unsafe { ::std::ptr::NonNull::new_unchecked(::std::ptr::addr_of_mut!(DATA)) }
}

#[inline]
Expand Down

0 comments on commit 8052e13

Please sign in to comment.