2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ impl<T> ManuallyDrop<T> {
62
62
/// x.truncate(5); // You can still safely operate on the value
63
63
/// assert_eq!(*x, "Hello");
64
64
/// // But `Drop` will not be run here
65
+ /// # // FIXME(https://github.com/rust-lang/miri/issues/3670):
66
+ /// # // use -Zmiri-disable-leak-check instead of unleaking in tests meant to leak.
67
+ /// # let _ = ManuallyDrop::into_inner(x);
65
68
/// ```
66
69
#[ must_use = "if you don't need the wrapper, you can use `mem::forget` instead" ]
67
70
#[ stable( feature = "manually_drop" , since = "1.20.0" ) ]
Original file line number Diff line number Diff line change @@ -448,6 +448,9 @@ impl<T> MaybeUninit<T> {
448
448
/// let mut x = MaybeUninit::<String>::uninit();
449
449
///
450
450
/// x.write("Hello".to_string());
451
+ /// # // FIXME(https://github.com/rust-lang/miri/issues/3670):
452
+ /// # // use -Zmiri-disable-leak-check instead of unleaking in tests meant to leak.
453
+ /// # unsafe { MaybeUninit::assume_init_drop(&mut x); }
451
454
/// // This leaks the contained string:
452
455
/// x.write("hello".to_string());
453
456
/// // x is initialized now:
0 commit comments