diff options
| author | Alexis Bourget <alexis.bourget@gmail.com> | 2020-07-29 21:58:09 +0200 |
|---|---|---|
| committer | Alexis Bourget <alexis.bourget@gmail.com> | 2020-07-29 21:58:09 +0200 |
| commit | 82ccdab96cd8c146d9958c1050a2d2669dd367e8 (patch) | |
| tree | df6ce4ac3cd6c354da7b346200dfd6946c8e276d /library/std/src/thread | |
| parent | 2c28244cf0fc9868f55070e55b8f332d196eaf3f (diff) | |
| download | rust-82ccdab96cd8c146d9958c1050a2d2669dd367e8.tar.gz rust-82ccdab96cd8c146d9958c1050a2d2669dd367e8.zip | |
Disallow missing unsafe blocks in unsafe fn in panicking.rs
This adds SAFETY comments where necessary, explaining the preconditions and how they are respected.
Diffstat (limited to 'library/std/src/thread')
| -rw-r--r-- | library/std/src/thread/local.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs index ecd6fbc6b93..66508f06b28 100644 --- a/library/std/src/thread/local.rs +++ b/library/std/src/thread/local.rs @@ -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 { |
