diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-06-30 21:57:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-30 21:57:27 +0200 |
| commit | c779f4e89c0abe949195a28418be11fddf77b5a3 (patch) | |
| tree | 048167f90014ffc91740a16d4be6ba687acab210 /src/libstd | |
| parent | 1683bb7771640ec534c97d99fdc853d3090a30bf (diff) | |
| parent | 400fd6055fea43ccd89769a4ddb85586c70bf8ae (diff) | |
| download | rust-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.rs | 4 |
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); + } } } } |
