Skip to content

Commit b479139

Browse files
committed
Remove intrinsics::arith_offset use from libarena
The use of arith_offset was added in 803e9ae before the stable wrapper of the intrinsic was available. https://doc.rust-lang.org/stable/std/intrinsics/fn.arith_offset.html
1 parent 285fc7d commit b479139

File tree

1 file changed

+1
-3
lines changed
  • compiler/rustc_arena/src

1 file changed

+1
-3
lines changed

compiler/rustc_arena/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
html_root_url = "https://doc.rust-lang.org/nightly/",
1212
test(no_crate_inject, attr(deny(warnings)))
1313
)]
14-
#![feature(core_intrinsics)]
1514
#![feature(dropck_eyepatch)]
1615
#![feature(raw_vec_internals)]
1716
#![cfg_attr(test, feature(test))]
@@ -25,7 +24,6 @@ use smallvec::SmallVec;
2524
use std::alloc::Layout;
2625
use std::cell::{Cell, RefCell};
2726
use std::cmp;
28-
use std::intrinsics;
2927
use std::marker::{PhantomData, Send};
3028
use std::mem;
3129
use std::ptr;
@@ -130,7 +128,7 @@ impl<T> TypedArena<T> {
130128

131129
unsafe {
132130
if mem::size_of::<T>() == 0 {
133-
self.ptr.set(intrinsics::arith_offset(self.ptr.get() as *mut u8, 1) as *mut T);
131+
self.ptr.set((self.ptr.get() as *mut u8).wrapping_offset(1) as *mut T);
134132
let ptr = mem::align_of::<T>() as *mut T;
135133
// Don't drop the object. This `write` is equivalent to `forget`.
136134
ptr::write(ptr, object);

0 commit comments

Comments
 (0)