]> git.lizzy.rs Git - rust.git/commitdiff
Fix unused variable warning in doctest
authorDylan MacKenzie <ecstaticmorse@gmail.com>
Thu, 24 May 2018 16:05:56 +0000 (09:05 -0700)
committerRalf Jung <post@ralfj.de>
Wed, 29 Aug 2018 08:10:58 +0000 (10:10 +0200)
src/libcore/ptr.rs

index eaff30937676215b5694e79ecd70e8ba86339544..e02ee09c8af008b39f6834c1e30c207d754409d1 100644 (file)
@@ -407,6 +407,7 @@ pub unsafe fn replace<T>(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.