summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/issue-91827-extern-types.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const-eval/issue-91827-extern-types.rs')
-rw-r--r--tests/ui/consts/const-eval/issue-91827-extern-types.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/ui/consts/const-eval/issue-91827-extern-types.rs b/tests/ui/consts/const-eval/issue-91827-extern-types.rs
index 43c99799f..c9aaa6e55 100644
--- a/tests/ui/consts/const-eval/issue-91827-extern-types.rs
+++ b/tests/ui/consts/const-eval/issue-91827-extern-types.rs
@@ -28,7 +28,10 @@ pub struct ListImpl<T, const N: usize> {
impl<T> List<T> {
const fn as_slice(&self) -> &[T] {
- unsafe { std::slice::from_raw_parts(self.data.as_ptr(), self.len) }
+ unsafe {
+ let ptr = addr_of!(self.tail) as *const T;
+ std::slice::from_raw_parts(ptr, self.len)
+ }
}
}