1
Fork 0

Disallow missing unsafe blocks in unsafe fn in panicking.rs

This adds SAFETY comments where necessary, explaining the preconditions
and how they are respected.
This commit is contained in:
Alexis Bourget 2020-07-29 21:58:09 +02:00
parent 2c28244cf0
commit 82ccdab96c
2 changed files with 49 additions and 7 deletions

View file

@ -172,7 +172,11 @@ macro_rules! __thread_local_inner {
static __KEY: $crate::thread::__OsLocalKeyInner<$t> =
$crate::thread::__OsLocalKeyInner::new();
__KEY.get(__init)
// FIXME: remove the #[allow(...)] marker when macros don't
// raise warning for missing/extraneous unsafe blocks anymore.
// See https://github.com/rust-lang/rust/issues/74838.
#[allow(unused_unsafe)]
unsafe { __KEY.get(__init) }
}
unsafe {