diff --git a/c2rust-transpile/src/translator/operators.rs b/c2rust-transpile/src/translator/operators.rs index fb39c99f24..351d2aa6cf 100644 --- a/c2rust-transpile/src/translator/operators.rs +++ b/c2rust-transpile/src/translator/operators.rs @@ -736,12 +736,7 @@ impl<'c> Translation<'c> { "Cannot use wrapping offset from in a const expression", )); } - // The wrapping_offset_from method is locked behind a feature gate - // and replaces the now deprecated offset_to (opposite argument order) - // wrapping_offset_from panics when the pointee is a ZST - self.use_feature("ptr_wrapping_offset_from"); - - let mut offset = mk().method_call_expr(lhs, "wrapping_offset_from", vec![rhs]); + let mut offset = mk().method_call_expr(lhs, "offset_from", vec![rhs]); if let Some(sz) = self.compute_size_of_expr(pointee.ctype) { let div = cast_int(sz, "isize", false); diff --git a/tests/pointers/src/test_pointers.rs b/tests/pointers/src/test_pointers.rs index f37f616581..40773c35e8 100644 --- a/tests/pointers/src/test_pointers.rs +++ b/tests/pointers/src/test_pointers.rs @@ -1,4 +1,4 @@ -//! feature_c_variadic, feature_ptr_wrapping_offset_from +//! feature_c_variadic extern crate libc;