File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change
1
+ // compile-flags: -Zmiri-track-raw-pointers
1
2
#![ feature( new_uninit) ]
2
3
#![ feature( slice_as_chunks) ]
3
4
#![ feature( slice_partition_dedup) ]
@@ -220,13 +221,23 @@ fn test_for_invalidated_pointers() {
220
221
221
222
// Calls `fn as_chunks_unchecked_mut` internally (requires unstable `#![feature(slice_as_chunks)]`):
222
223
assert_eq ! ( 2 , buffer. as_chunks_mut:: <32 >( ) . 0 . len( ) ) ;
224
+ for chunk in buffer. as_chunks_mut :: < 32 > ( ) . 0 {
225
+ for elem in chunk {
226
+ * elem += 1 ;
227
+ }
228
+ }
223
229
224
230
// Calls `fn split_at_mut_unchecked` internally:
225
231
let split_mut = buffer. split_at_mut ( 32 ) ;
226
232
assert_eq ! ( split_mut. 0 , split_mut. 1 ) ;
227
233
228
234
// Calls `fn partition_dedup_by` internally (requires unstable `#![feature(slice_partition_dedup)]`):
229
- assert_eq ! ( 1 , buffer. partition_dedup( ) . 0 . len( ) ) ;
235
+ let partition_dedup = buffer. partition_dedup ( ) ;
236
+ assert_eq ! ( 1 , partition_dedup. 0 . len( ) ) ;
237
+ partition_dedup. 0 [ 0 ] += 1 ;
238
+ for elem in partition_dedup. 1 {
239
+ * elem += 1 ;
240
+ }
230
241
231
242
buffer. rotate_left ( 8 ) ;
232
243
buffer. rotate_right ( 16 ) ;
You can’t perform that action at this time.
0 commit comments