Skip to content

Commit 5719891

Browse files
MIRI doctests
1 parent 8d5f0bb commit 5719891

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ let pt: *mut bool = b as *mut bool;
270270

271271
let _: &'static mut bool = unsafe_mut!(pt, 'static);
272272
let _ = unsafe_mut!(pt, 'static);
273+
# let _drop_for_miri = unsafe { Box::from_raw(b) };
273274
```
274275

275276
## unsafe_mut - two args, lifetimed dyn reference
@@ -281,17 +282,18 @@ let pt: *mut bool = b as *mut bool;
281282

282283
let _: &'static mut dyn Display = unsafe_mut!(pt, 'static);
283284
let _ = unsafe_mut!(pt, 'static);
285+
# let _drop_for_miri = unsafe { Box::from_raw(b) };
284286
```
285287

286288
## unsafe_mut - two args, lifetimed slice
287289
```rust
288290
# use prudent::unsafe_mut;
289-
let b: &'static mut [bool] = Box::leak( Box::new([true, false]) );
290-
let pt: *mut [bool] = b as *mut [bool];
291+
let bs: &'static mut [bool] = Box::leak( Box::new([true, false]) );
292+
let pt: *mut [bool] = bs as *mut [bool];
291293

292294
let _: &'static mut [bool] = unsafe_mut!(pt, 'static);
293295
let _ = unsafe_mut!(pt, 'static);
294-
296+
# let _drop_for_miri = unsafe { Box::from_raw(bs) };
295297
```
296298

297299
## unsafe_mut - two args, typed basic reference
@@ -312,6 +314,7 @@ let pt: *mut [bool] = bs as *mut [bool];
312314

313315
let _: &mut [bool] = unsafe_mut!(pt, [bool]);
314316
let _ = unsafe_mut!(pt, [bool]);
317+
# let _drop_for_miri = unsafe { Box::from_raw(bs) };
315318
```
316319

317320
## unsafe_mut - two args, typed dyn reference

0 commit comments

Comments
 (0)