fix function_casts_as_integer warning

Comparing addresses of function pointers is brittle.

Functions may be duplicated resulting in function pointers to the same function to compare !=.
Functions may be merged/de-duplicated resulting in function pointers to different function to compare ==.

The later shouldn't be relevant here as the function differ in behavior, but mentioning it for completeness.
This commit is contained in:
Skgland
2025-11-27 20:07:13 +01:00
committed by Bennet Bleßmann
parent f570e566f8
commit 797a8f8611
6 changed files with 107 additions and 55 deletions

View File

@@ -64,8 +64,7 @@ impl MachineState {
cc: 0,
global_clock: 0,
dynamic_mode: FirstOrNext::First,
unify_fn: MachineState::unify,
bind_fn: MachineState::bind,
occurs_check: &Nsto,
run_cleaners_fn: |_| false,
}
}
@@ -951,7 +950,7 @@ impl MachineState {
}
};
(self.bind_fn)(self, r, f_a);
self.occurs_check.bind(self, r, f_a);
Ok(())
}