Skip to content

Commit 4547de6

Browse files
committed
gc/mmtk: avoid fn_addr_eq for MSRV 1.74
Gbp-Pq: Name gc-mmtk-avoid-fn_addr_eq-for-MSRV-1.74.patch
1 parent 2955bcd commit 4547de6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

gc/mmtk/src/abi.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ impl ObjectClosure {
153153
///
154154
/// Note that this function is not reentrant. Don't call this function in either `callback` or
155155
/// `f`.
156+
#[allow(unpredictable_function_pointer_comparisons)]
156157
pub fn set_temporarily_and_run_code<'env, T, F1, F2>(
157158
&mut self,
158159
mut visit_object: F1,
@@ -163,7 +164,7 @@ impl ObjectClosure {
163164
F2: 'env + FnOnce() -> T,
164165
{
165166
debug_assert!(
166-
std::ptr::fn_addr_eq(self.c_function, THE_UNREGISTERED_CLOSURE_FUNC),
167+
self.c_function == THE_UNREGISTERED_CLOSURE_FUNC,
167168
"set_temporarily_and_run_code is recursively called."
168169
);
169170
self.c_function = Self::c_function_registered::<F1>;

0 commit comments

Comments
 (0)