Mitigate focused memory leaks in core doctests for Miri. · model-checking/verify-rust-std@5515bba (original) (raw)

Original file line number Diff line number Diff line change
@@ -62,6 +62,9 @@ impl ManuallyDrop {
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")]