diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index 0978b3c9280..f10a82c5694 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -409,8 +409,7 @@ pub const fn new(value: T) -> Cell { #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn set(&self, val: T) { - let old = self.replace(val); - drop(old); + self.replace(val); } /// Swaps the values of two `Cell`s.