Skip to content

Commit aa99ae1

Browse files
committed
Explicitly allow the static mut references where necessary
1 parent f828ccf commit aa99ae1

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

rustler/src/resource/traits.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type NifResourcePtr = *const ErlNifResourceType;
1212
static mut RESOURCE_TYPES: OnceLock<HashMap<TypeId, usize>> = OnceLock::new();
1313

1414
/// Register an Erlang resource type handle for a particular type given by its `TypeId`
15+
#[allow(static_mut_refs)]
1516
pub(crate) unsafe fn register_resource_type(type_id: TypeId, resource_type: NifResourcePtr) {
1617
RESOURCE_TYPES.get_or_init(Default::default);
1718
RESOURCE_TYPES
@@ -64,6 +65,7 @@ pub trait Resource: Sized + Send + Sync + 'static {
6465
#[doc(hidden)]
6566
pub(crate) trait ResourceExt: 'static {
6667
/// Get the NIF resource type handle for this type if it had been registered before
68+
#[allow(static_mut_refs)]
6769
fn get_resource_type() -> Option<NifResourcePtr> {
6870
let map = unsafe { RESOURCE_TYPES.get()? };
6971
map.get(&TypeId::of::<Self>())

rustler/src/sys/functions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub unsafe fn internal_set_symbols(callbacks: DynNifCallbacks) {
1010
DYN_NIF_CALLBACKS = callbacks;
1111
}
1212

13+
#[allow(static_mut_refs)]
1314
pub unsafe fn internal_write_symbols() {
1415
let filler = nif_filler::new();
1516
DYN_NIF_CALLBACKS.write_symbols(filler);

0 commit comments

Comments
 (0)