about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-06-30 21:57:27 +0200
committerGitHub <noreply@github.com>2019-06-30 21:57:27 +0200
commitc779f4e89c0abe949195a28418be11fddf77b5a3 (patch)
tree048167f90014ffc91740a16d4be6ba687acab210 /src/libstd
parent1683bb7771640ec534c97d99fdc853d3090a30bf (diff)
parent400fd6055fea43ccd89769a4ddb85586c70bf8ae (diff)
downloadrust-c779f4e89c0abe949195a28418be11fddf77b5a3.tar.gz
rust-c779f4e89c0abe949195a28418be11fddf77b5a3.zip
Rollup merge of #62228 - varkor:must_use-trait-in-box, r=Centril
Extend the #[must_use] lint to boxed types

Fixes https://github.com/rust-lang/rust/issues/55506#issuecomment-506940181 (cc @Nemo157).

This should have been included as part of https://github.com/rust-lang/rust/pull/55663, but was overlooked.
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);
+            }
         }
     }
 }