about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2019-06-29 13:53:46 +0100
committervarkor <github@varkor.com>2019-06-30 18:19:28 +0100
commitb613ef143641382f7474f9ef2260e276514f3862 (patch)
tree2d3a03edd4fd9196fdd085438f345d55b405efd4 /src/libstd
parent0af8e872ea5ac77effa59f8d3f8794f12cb8865c (diff)
downloadrust-b613ef143641382f7474f9ef2260e276514f3862.tar.gz
rust-b613ef143641382f7474f9ef2260e276514f3862.zip
Extend the #[must_use] lint to boxed types
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/panicking.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstd/panicking.rs b/src/libstd/panicking.rs
index 9ef42063f94..797d85e941d 100644
--- a/src/libstd/panicking.rs
+++ b/src/libstd/panicking.rs
@@ -103,7 +103,9 @@ pub fn set_hook(hook: Box<dyn Fn(&PanicInfo<'_>) + 'static + Sync + Send>) {
         HOOK_LOCK.write_unlock();
 
         if let Hook::Custom(ptr) = old_hook {
-            Box::from_raw(ptr);
+            #[allow(unused_must_use)] {
+                Box::from_raw(ptr);
+            }
         }
     }
 }