about summary refs log tree commit diff
path: root/library/coretests
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2025-09-08 10:40:18 +0200
committerRalf Jung <post@ralfj.de>2025-09-08 13:22:52 +0200
commitaed0ed4c93d661fc7b66dc4a39690948476e8a4a (patch)
treedefedf24675aa706b949f66950d41ac2ffa1fbc0 /library/coretests
parentebdf2abea4b46fcbba959eee1207c979c77dc95c (diff)
downloadrust-aed0ed4c93d661fc7b66dc4a39690948476e8a4a.tar.gz
rust-aed0ed4c93d661fc7b66dc4a39690948476e8a4a.zip
const-eval: disable pointer fragment support
Diffstat (limited to 'library/coretests')
-rw-r--r--library/coretests/tests/ptr.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/library/coretests/tests/ptr.rs b/library/coretests/tests/ptr.rs
index c13fb96a67f..f8774833d0a 100644
--- a/library/coretests/tests/ptr.rs
+++ b/library/coretests/tests/ptr.rs
@@ -936,12 +936,13 @@ fn test_const_swap_ptr() {
         assert!(*s1.0.ptr == 666);
         assert!(*s2.0.ptr == 1);
 
-        // Swap them back, byte-for-byte
+        // Swap them back, again as an array.
+        // FIXME(#146291): we should be swapping back at type `u8` but that currently does not work.
         unsafe {
             ptr::swap_nonoverlapping(
-                ptr::from_mut(&mut s1).cast::<u8>(),
-                ptr::from_mut(&mut s2).cast::<u8>(),
-                size_of::<A>(),
+                ptr::from_mut(&mut s1).cast::<T>(),
+                ptr::from_mut(&mut s2).cast::<T>(),
+                1,
             );
         }