diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index eaff3093767..e02ee09c8af 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -407,6 +407,7 @@ pub unsafe fn replace(dest: *mut T, mut src: T) -> T { /// // this point, `s` must no longer be used, as the underlying memory has /// // been freed. /// s2 = String::default(); +/// assert_eq!(s2, ""); /// /// // Assigning to `s` would cause the old value to be dropped again, /// // resulting in undefined behavior.