]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/util.rs
switch Drop to `&mut self`
[rust.git] / src / libstd / util.rs
index 5085f337d4bba216103ddf9f17c1505dca509123..e8bcceb85fa689ed9574281cab1e752722f0c45b 100644 (file)
@@ -88,7 +88,7 @@ pub fn new() -> NonCopyable { NonCopyable }
 }
 
 impl Drop for NonCopyable {
-    fn drop(&self) { }
+    fn drop(&mut self) { }
 }
 
 /// A type with no inhabitants
@@ -188,7 +188,7 @@ fn test_noncopyable() {
         struct Foo { five: int }
 
         impl Drop for Foo {
-            fn drop(&self) {
+            fn drop(&mut self) {
                 assert_eq!(self.five, 5);
                 unsafe {
                     did_run = true;