diff options
| author | bors <bors@rust-lang.org> | 2022-04-02 02:35:03 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-04-02 02:35:03 +0000 |
| commit | 79f178b76ea9d5c6182f67413f62dd86b0e38508 (patch) | |
| tree | 6b246b60668f826a00e2264255f7c2e4237ed837 /library/std/src/thread | |
| parent | c75909c2340c0f8bdf20079b34025fbf3b952985 (diff) | |
| parent | 1c82fac3f7ca41937faf8b8ade8e120259255b88 (diff) | |
| download | rust-79f178b76ea9d5c6182f67413f62dd86b0e38508.tar.gz rust-79f178b76ea9d5c6182f67413f62dd86b0e38508.zip | |
Auto merge of #95581 - Dylan-DPC:rollup-2suh5h1, r=Dylan-DPC
Rollup of 8 pull requests Successful merges: - #95354 (Handle rustc_const_stable attribute in library feature collector) - #95373 (invalid_value lint: detect invalid initialization of arrays) - #95430 (Disable #[thread_local] support on i686-pc-windows-msvc) - #95544 (Add error message suggestion for missing noreturn in naked function) - #95556 (Implement provenance preserving methods on NonNull) - #95557 (Fix `thread_local!` macro to be compatible with `no_implicit_prelude`) - #95559 (small type system refactoring) - #95560 (convert more `DefId`s to `LocalDefId`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/thread')
| -rw-r--r-- | library/std/src/thread/local.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs index ca29261b1c9..587e453ceef 100644 --- a/library/std/src/thread/local.rs +++ b/library/std/src/thread/local.rs @@ -193,7 +193,7 @@ macro_rules! __thread_local_inner { #[cfg(all(target_family = "wasm", not(target_feature = "atomics")))] { static mut VAL: $t = INIT_EXPR; - Some(&VAL) + $crate::option::Option::Some(&VAL) } // If the platform has support for `#[thread_local]`, use it. @@ -209,7 +209,7 @@ macro_rules! __thread_local_inner { // just get going. if !$crate::mem::needs_drop::<$t>() { unsafe { - return Some(&VAL) + return $crate::option::Option::Some(&VAL) } } @@ -223,7 +223,7 @@ macro_rules! __thread_local_inner { let ptr = ptr as *mut $t; unsafe { - debug_assert_eq!(STATE, 1); + $crate::debug_assert_eq!(STATE, 1); STATE = 2; $crate::ptr::drop_in_place(ptr); } @@ -239,14 +239,14 @@ macro_rules! __thread_local_inner { destroy, ); STATE = 1; - Some(&VAL) + $crate::option::Option::Some(&VAL) } // 1 == the destructor is registered and the value // is valid, so return the pointer. - 1 => Some(&VAL), + 1 => $crate::option::Option::Some(&VAL), // otherwise the destructor has already run, so we // can't give access. - _ => None, + _ => $crate::option::Option::None, } } } @@ -269,7 +269,7 @@ macro_rules! __thread_local_inner { if let $crate::option::Option::Some(value) = init.take() { return value; } else if $crate::cfg!(debug_assertions) { - unreachable!("missing initial value"); + $crate::unreachable!("missing initial value"); } } __init() @@ -344,7 +344,7 @@ macro_rules! __thread_local_inner { if let $crate::option::Option::Some(value) = init.take() { return value; } else if $crate::cfg!(debug_assertions) { - unreachable!("missing default value"); + $crate::unreachable!("missing default value"); } } __init() |
