Skip to content

Commit

Permalink
Revert "inline const for offset"
Browse files Browse the repository at this point in the history
This reverts commit 88f3fbc.
  • Loading branch information
Congyuwang committed Feb 29, 2024
1 parent 79e4082 commit d0d11c3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(inline_const)]
use std::{
marker::PhantomData,
mem::{offset_of, MaybeUninit},
Expand Down Expand Up @@ -282,14 +281,14 @@ impl<T> ListHead<T> {
#[inline(always)]
unsafe fn inner(&self) -> &Inner<T> {
&*(ptr::from_ref(self)
.byte_offset(const { Self::offset() })
.byte_offset(Self::offset())
.cast::<Inner<T>>())
}

#[inline(always)]
unsafe fn inner_mut(&mut self) -> &mut Inner<T> {
&mut *(ptr::from_mut(self)
.byte_offset(const { Self::offset() })
.byte_offset(Self::offset())
.cast::<Inner<T>>())
}

Expand Down

0 comments on commit d0d11c3

Please sign in to comment.