Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find __OsLocalKeyInner in thread when running cargo install #102549

Closed
SumiGovindaraju opened this issue Oct 1, 2022 · 20 comments
Closed
Labels
A-thread-locals Area: Thread local storage (TLS) C-bug Category: This is a bug. O-macos Operating system: macOS

Comments

@SumiGovindaraju
Copy link

I tried this code:

cargo install cargo-binutils

The installation of this crate should work, but instead I run into this error (I also see the same error when trying to build other personal repositories):

Console Output
    Updating crates.io index
  Installing cargo-binutils v0.3.6
   Compiling proc-macro2 v1.0.46
   Compiling unicode-ident v1.0.4
   Compiling quote v1.0.21
   Compiling syn v1.0.101
   Compiling serde_derive v1.0.145
   Compiling serde v1.0.145
   Compiling memchr v2.5.0
   Compiling libc v0.2.134
   Compiling cc v1.0.73
   Compiling adler v1.0.2
   Compiling semver v1.0.14
   Compiling failure_derive v0.1.8
   Compiling unicode-xid v0.2.4
   Compiling gimli v0.26.2
   Compiling miniz_oxide v0.5.4
   Compiling rustc-demangle v0.1.21
   Compiling camino v1.1.1
   Compiling object v0.29.0
   Compiling backtrace v0.3.66
   Compiling cfg-if v1.0.0
   Compiling serde_json v1.0.85
   Compiling unicode-width v0.1.10
   Compiling itoa v1.0.3
   Compiling ryu v1.0.11
   Compiling anyhow v1.0.65
   Compiling textwrap v0.11.0
   Compiling atty v0.2.14
   Compiling aho-corasick v0.7.19
   Compiling vec_map v0.8.2
   Compiling strsim v0.8.0
   Compiling bitflags v1.3.2
   Compiling regex-syntax v0.6.27
   Compiling ansi_term v0.12.1
   Compiling clap v2.34.0
   Compiling addr2line v0.17.0
   Compiling synstructure v0.12.6
   Compiling regex v1.6.0
error[E0433]: failed to resolve: could not find `__OsLocalKeyInner` in `thread`
   --> /Users/sumukhgovindaraju/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/backtrace-0.3.66/src/lib.rs:163:5
    |
163 |     thread_local!(static LOCK_HELD: Cell<bool> = Cell::new(false));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not find `__OsLocalKeyInner` in `thread`
    |
    = note: this error originates in the macro `$crate::__thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)

WARN rustc_errors::emitter Invalid span /rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs:338:47: 338:64 (#147), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "/rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs" }) }
error[E0412]: cannot find type `__OsLocalKeyInner` in module `$crate::thread`
   --> /Users/sumukhgovindaraju/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/backtrace-0.3.66/src/lib.rs:163:5
    |
163 |     thread_local!(static LOCK_HELD: Cell<bool> = Cell::new(false));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `__FastLocalKeyInner`
    |
    = note: this error originates in the macro `$crate::__thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `__OsLocalKeyInner` in `thread`
  --> /Users/sumukhgovindaraju/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/regex-1.6.0/src/pool.rs:67:1
   |
67 | / thread_local!(
68 | |     /// A thread local used to assign an ID to a thread.
69 | |     static THREAD_ID: usize = {
70 | |         let next = COUNTER.fetch_add(1, Ordering::Relaxed);
...  |
84 | |     };
85 | | );
   | |_^ could not find `__OsLocalKeyInner` in `thread`
   |
   = note: this error originates in the macro `$crate::__thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)

WARN rustc_errors::emitter Invalid span /rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs:338:47: 338:64 (#472), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "/rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs" }) }
error[E0412]: cannot find type `__OsLocalKeyInner` in module `$crate::thread`
  --> /Users/sumukhgovindaraju/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/regex-1.6.0/src/pool.rs:67:1
   |
67 | / thread_local!(
68 | |     /// A thread local used to assign an ID to a thread.
69 | |     static THREAD_ID: usize = {
70 | |         let next = COUNTER.fetch_add(1, Ordering::Relaxed);
...  |
84 | |     };
85 | | );
   | |_^ help: a struct with a similar name exists: `__FastLocalKeyInner`
   |
   = note: this error originates in the macro `$crate::__thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0412, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `backtrace` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `regex` due to 2 previous errors
error: failed to compile `cargo-binutils v0.3.6`, intermediate artifacts can be found at `/var/folders/jg/pgt0p9hj0cv0pk6fq9g4wjb40000gn/T/cargo-installLNnPUU`

Meta

rustc --version --verbose:

rustc 1.66.0-nightly (8ce3204af 2022-09-30)
binary: rustc
commit-hash: 8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6
commit-date: 2022-09-30
host: aarch64-apple-darwin
release: 1.66.0-nightly
LLVM version: 15.0.2
Backtrace

    Updating crates.io index
  Installing cargo-binutils v0.3.6
   Compiling proc-macro2 v1.0.46
   Compiling unicode-ident v1.0.4
   Compiling quote v1.0.21
   Compiling syn v1.0.101
   Compiling serde_derive v1.0.145
   Compiling serde v1.0.145
   Compiling memchr v2.5.0
   Compiling libc v0.2.134
   Compiling cc v1.0.73
   Compiling adler v1.0.2
   Compiling unicode-xid v0.2.4
   Compiling semver v1.0.14
   Compiling gimli v0.26.2
   Compiling failure_derive v0.1.8
   Compiling miniz_oxide v0.5.4
   Compiling cfg-if v1.0.0
   Compiling camino v1.1.1
   Compiling serde_json v1.0.85
   Compiling backtrace v0.3.66
   Compiling object v0.29.0
   Compiling rustc-demangle v0.1.21
   Compiling itoa v1.0.3
   Compiling ryu v1.0.11
   Compiling unicode-width v0.1.10
   Compiling anyhow v1.0.65
   Compiling textwrap v0.11.0
   Compiling atty v0.2.14
   Compiling aho-corasick v0.7.19
   Compiling vec_map v0.8.2
   Compiling regex-syntax v0.6.27
   Compiling strsim v0.8.0
   Compiling ansi_term v0.12.1
   Compiling addr2line v0.17.0
   Compiling bitflags v1.3.2
   Compiling clap v2.34.0
   Compiling synstructure v0.12.6
   Compiling regex v1.6.0
error[E0433]: failed to resolve: could not find `__OsLocalKeyInner` in `thread`
   |
  ::: /Users/sumukhgovindaraju/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/regex-1.6.0/src/pool.rs:67:1
   |
67 | / thread_local!(
68 | |     /// A thread local used to assign an ID to a thread.
69 | |     static THREAD_ID: usize = {
70 | |         let next = COUNTER.fetch_add(1, Ordering::Relaxed);
...  |
84 | |     };
85 | | );
   | |_- in this macro invocation (#1)

WARN rustc_errors::emitter Invalid span /rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs:338:47: 338:64 (#472), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "/rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs" }) }
error[E0412]: cannot find type `__OsLocalKeyInner` in module `$crate::thread`
   |
  ::: /Users/sumukhgovindaraju/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/regex-1.6.0/src/pool.rs:67:1
   |
67 | / thread_local!(
68 | |     /// A thread local used to assign an ID to a thread.
69 | |     static THREAD_ID: usize = {
70 | |         let next = COUNTER.fetch_add(1, Ordering::Relaxed);
...  |
84 | |     };
85 | | );
   | |_- in this macro invocation (#1)

Some errors have detailed explanations: E0412, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `regex` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error[E0433]: failed to resolve: could not find `__OsLocalKeyInner` in `thread`
    |
   ::: /Users/sumukhgovindaraju/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/backtrace-0.3.66/src/lib.rs:163:5
    |
163 |     thread_local!(static LOCK_HELD: Cell<bool> = Cell::new(false));
    |     -------------------------------------------------------------- in this macro invocation (#1)

WARN rustc_errors::emitter Invalid span /rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs:338:47: 338:64 (#147), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "/rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs" }) }
error[E0412]: cannot find type `__OsLocalKeyInner` in module `$crate::thread`
    |
   ::: /Users/sumukhgovindaraju/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/backtrace-0.3.66/src/lib.rs:163:5
    |
163 |     thread_local!(static LOCK_HELD: Cell<bool> = Cell::new(false));
    |     -------------------------------------------------------------- in this macro invocation (#1)

error: could not compile `backtrace` due to 2 previous errors
error: failed to compile `cargo-binutils v0.3.6`, intermediate artifacts can be found at `/var/folders/jg/pgt0p9hj0cv0pk6fq9g4wjb40000gn/T/cargo-installqHa6cL`

Thanks for looking into this! Any help is appreciated.

@SumiGovindaraju SumiGovindaraju added the C-bug Category: This is a bug. label Oct 1, 2022
@RalfJung
Copy link
Member

RalfJung commented Oct 6, 2022

This looks like it might be related to #100201. But given that CI passed that change in general seems to work, and it has landed 6 weeks ago without exploding the world, so the question is why it would fail only for you?

If you just try to build this as a crate with no dependencies, does that work?

use std::cell::Cell;

thread_local!(static LOCK_HELD: Cell<bool> = Cell::new(false));

fn main() {}

If that still shows the error, what does rustc filename.rs --pretty=expanded on that file show?

@SumiGovindaraju
Copy link
Author

This still throws the same error:
cargo build:

   Compiling hello_world v0.1.0 (/Users/sumukhgovindaraju/github.com/Penn-Electric-Racing/hello_world)
error[E0433]: failed to resolve: could not find `__OsLocalKeyInner` in `thread`
 --> src/lib.rs:3:1
  |
3 | thread_local!(static LOCK_HELD: Cell<bool> = Cell::new(false));
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not find `__OsLocalKeyInner` in `thread`
  |
  = note: this error originates in the macro `$crate::__thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0412]: cannot find type `__OsLocalKeyInner` in module `$crate::thread`
   --> src/lib.rs:3:1
    |
3   | thread_local!(static LOCK_HELD: Cell<bool> = Cell::new(false));
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `__FastLocalKeyInner`
    |
   ::: /Users/sumukhgovindaraju/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:924:5
    |
924 |     pub struct Key<T> {
    |     ----------------- similarly named struct `__FastLocalKeyInner` defined here
    |
    = note: this error originates in the macro `$crate::__thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0412, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `hello_world` due to 2 previous errors

I tried running rustc src/lib.rs --pretty=expanded and rustc -Z unstable-options --pretty=expanded and both of them give the following error: error: Unrecognized option: 'pretty'. Is there an alternate command I can use?

@RalfJung
Copy link
Member

RalfJung commented Oct 7, 2022

@thomcc you're on macOS right? Any chance it's a aarch64-apple-darwin? AFAIK our CI builders are x86 machines, so maybe this has to do with the aarch64 target -- but I am sure we would have heard sooner if thread_local was entirely broken on aarch64-apple-darwin...

I tried running rustc src/lib.rs --pretty=expanded and rustc -Z unstable-options --pretty=expanded and both of them give the following error: error: Unrecognized option: 'pretty'. Is there an alternate command I can use?

Hm, that's what I get for copy-pasting commands from the web... I am looking for whatever the playground does when you ask it to 'expand macros'.

@RalfJung
Copy link
Member

RalfJung commented Oct 7, 2022

@SumiGovindaraju ah here we go: rustc -Zunpretty=expanded filename.rs. What does that print?

@SumiGovindaraju
Copy link
Author

Any chance it's a aarch64-apple-darwin?

Yes, it is.

Output of rustc -Zunpretty=expanded src/lib.rs:

error[E0433]: failed to resolve: could not find `__OsLocalKeyInner` in `thread`
 --> src/lib.rs:3:1
  |
3 | thread_local!(static LOCK_HELD: Cell<bool> = Cell::new(false));
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not find `__OsLocalKeyInner` in `thread`
  |
  = note: this error originates in the macro `$crate::__thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0412]: cannot find type `__OsLocalKeyInner` in module `$crate::thread`
   --> src/lib.rs:3:1
    |
3   | thread_local!(static LOCK_HELD: Cell<bool> = Cell::new(false));
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `__FastLocalKeyInner`
    |
   ::: /Users/sumukhgovindaraju/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:924:5
    |
924 |     pub struct Key<T> {
    |     ----------------- similarly named struct `__FastLocalKeyInner` defined here
    |
    = note: this error originates in the macro `$crate::__thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)

#![feature(prelude_import)]
#![no_std]
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
use std::cell::Cell;


const LOCK_HELD: ::std::thread::LocalKey<Cell<bool>> =
    {
        #[inline]
        fn __init() -> Cell<bool> { Cell::new(false) }
        #[inline]
        unsafe fn __getit(init:
                ::std::option::Option<&mut ::std::option::Option<Cell<bool>>>)
            -> ::std::option::Option<&'static Cell<bool>> {
            #[cfg(all(not(target_thread_local),
            not(all(target_family = "wasm",
            not(target_feature = "atomics"))),))]
            static __KEY: ::std::thread::__OsLocalKeyInner<Cell<bool>> =
                ::std::thread::__OsLocalKeyInner::new();

            #[allow(unused_unsafe)]
            unsafe {
                __KEY.get(move ||
                        {
                            if let ::std::option::Option::Some(init) = init {
                                    if let ::std::option::Option::Some(value) = init.take() {
                                            return value;
                                        } else if true {
                                           ::core::panicking::panic_fmt(::core::fmt::Arguments::new_v1(&["internal error: entered unreachable code: "],
                                                   &[::core::fmt::ArgumentV1::new_display(&::core::fmt::Arguments::new_v1(&["missing default value"],
                                                                           &[]))]));
                                       }
                                }
                            __init()
                        })
            }
        }
        unsafe { ::std::thread::LocalKey::new(__getit) }
    };
fn main() {}
error: aborting due to 2 previous errors

Some errors have detailed explanations: E0412, E0433.
For more information about an error, try `rustc --explain E0412`.

@RalfJung
Copy link
Member

RalfJung commented Oct 7, 2022

(I was asking whether @thomcc also has an aarch64 macOS so we can compare.)

Okay so it somehow picks the (inefficient) OsLocalKeyInner, but only in one of two places. Argh that code is so messy. But I can't see how this could ever happen...

@thomcc is it expected that an aarch64 apple target would use OsLocalKeyInner rather than FastLocalKeyInner?

@RalfJung
Copy link
Member

RalfJung commented Oct 7, 2022

@SumiGovindaraju could I also ask you for the output of running this program, compiled with the same toolchain?

#![feature(cfg_target_thread_local)]
fn main() {
    dbg!(cfg!(target_thread_local));
    dbg!(cfg!(not(all(target_family = "wasm", not(target_feature = "atomics")))));
}

@SumiGovindaraju
Copy link
Author

Output:

   Compiling test_crate v0.1.0 (/Users/sumukhgovindaraju/github.com/Penn-Electric-Racing/test_crate)
    Finished dev [unoptimized + debuginfo] target(s) in 0.35s
     Running `target/debug/test_crate`
[src/main.rs:3] cfg!(target_thread_local) = false
[src/main.rs:4] cfg!(not(all(target_family = "wasm", not(target_feature = "atomics")))) = true

@RalfJung
Copy link
Member

RalfJung commented Oct 7, 2022

So we really have cfg!(target_thread_local) = false. No idea if that is expected. And inexplicably, this does not get imported.

I am entirely unfamiliar with macOS details so I hope someone more familiar will pick this up here.

@RalfJung RalfJung added O-macos Operating system: macOS A-thread-locals Area: Thread local storage (TLS) labels Oct 7, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Oct 8, 2022
sync thread_local key conditions exactly with what the macro uses

This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`.

I don't think this should actually change anything, but seems better to be consistent?
I looked into this due to rust-lang#102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue.

r? `@thomcc`
@SumiGovindaraju
Copy link
Author

Hey, just was wondering if there was an update on this.

@thomcc
Copy link
Member

thomcc commented Oct 13, 2022

cfg!(target_thread_local) == false is definitely not expected on aarch64 macOS (and it's not the case locally for me). And I'm fairly sure it has not been broken on nightly...

@SumiGovindaraju
Copy link
Author

I'm not super familiar with this, so how/where is target_thread_local set? Could I set that to be true somehow?

@thomcc
Copy link
Member

thomcc commented Oct 13, 2022

It should be set with your target definition, which isn't something you can change. What does rustc --print cfg output for you?

@SumiGovindaraju
Copy link
Author

Output of rustc --print cfg:

debug_assertions
panic="unwind"
target_abi=""
target_arch="aarch64"
target_endian="little"
target_env=""
target_family="unix"
target_feature="aes"
target_feature="crc"
target_feature="dit"
target_feature="dotprod"
target_feature="dpb"
target_feature="dpb2"
target_feature="fcma"
target_feature="fhm"
target_feature="flagm"
target_feature="fp16"
target_feature="frintts"
target_feature="jsconv"
target_feature="llvm14-builtins-abi"
target_feature="lor"
target_feature="lse"
target_feature="neon"
target_feature="paca"
target_feature="pacg"
target_feature="pan"
target_feature="pmuv3"
target_feature="ras"
target_feature="rcpc"
target_feature="rcpc2"
target_feature="rdm"
target_feature="sb"
target_feature="sha2"
target_feature="sha3"
target_feature="ssbs"
target_feature="v8.1a"
target_feature="v8.2a"
target_feature="v8.3a"
target_feature="v8.4a"
target_feature="vh"
target_has_atomic="128"
target_has_atomic="16"
target_has_atomic="32"
target_has_atomic="64"
target_has_atomic="8"
target_has_atomic="ptr"
target_has_atomic_equal_alignment="128"
target_has_atomic_equal_alignment="16"
target_has_atomic_equal_alignment="32"
target_has_atomic_equal_alignment="64"
target_has_atomic_equal_alignment="8"
target_has_atomic_equal_alignment="ptr"
target_has_atomic_load_store="128"
target_has_atomic_load_store="16"
target_has_atomic_load_store="32"
target_has_atomic_load_store="64"
target_has_atomic_load_store="8"
target_has_atomic_load_store="ptr"
target_os="macos"
target_pointer_width="64"
target_vendor="apple"
unix

@thomcc
Copy link
Member

thomcc commented Oct 13, 2022

Yep, nearly identical to mine... except that I have target_thread_local set.

I guess I'll look into rustc-target tomorrow to see if there's some weird logic you're falling through, but this really makes no sense.

@thomcc
Copy link
Member

thomcc commented Oct 13, 2022

Hmm, do you happen have MACOSX_DEPLOYMENT_TARGET set in your environment? We do change the availability of thread locals based on this, if it's set to a version prior to when static thread locals worked at all.

We probably should not do this on aarch64, since all versions of macOS on this platform have thread locals (and once rust-lang/compiler-team#556 happens we perhaps shouldn't do it anywhere...).

(Ah, did you get rust through macports? I know they've been known to patch us to try to make us work with older versions of macOS... with dubious consequences. I don't know that there's a way to get a nightly Rust this way, though)

@SumiGovindaraju
Copy link
Author

MACOSX_DEPLOYMENT_TARGET is set to 10.6.

I got Rust using rustup.

@thomcc
Copy link
Member

thomcc commented Oct 13, 2022

Okay that's your problem. You should unset that environment variable.

@thomcc
Copy link
Member

thomcc commented Oct 13, 2022

FWIW, rust's oldest supported version of macOS is 10.7, and the oldest version we support on aarch64 targets is 11.0 (since this is the oldest version on these targets).

Anything else... may work? But is really dubious.

@SumiGovindaraju
Copy link
Author

Alright, that worked. Thanks for your help!

albertlarsan68 added a commit to albertlarsan68/rust that referenced this issue Oct 14, 2022
sync thread_local key conditions exactly with what the macro uses

This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`.

I don't think this should actually change anything, but seems better to be consistent?
I looked into this due to rust-lang#102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue.

r? `@thomcc`
bors added a commit to rust-lang-ci/rust that referenced this issue Oct 14, 2022
sync thread_local key conditions exactly with what the macro uses

This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`.

I don't think this should actually change anything, but seems better to be consistent?
I looked into this due to rust-lang#102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue.

r? `@thomcc`
RalfJung pushed a commit to RalfJung/miri that referenced this issue Oct 21, 2022
sync thread_local key conditions exactly with what the macro uses

This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`.

I don't think this should actually change anything, but seems better to be consistent?
I looked into this due to rust-lang/rust#102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue.

r? `@thomcc`
thomcc pushed a commit to tcdi/postgrestd that referenced this issue Feb 10, 2023
sync thread_local key conditions exactly with what the macro uses

This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`.

I don't think this should actually change anything, but seems better to be consistent?
I looked into this due to rust-lang/rust#102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue.

r? `@thomcc`
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 20, 2024
sync thread_local key conditions exactly with what the macro uses

This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`.

I don't think this should actually change anything, but seems better to be consistent?
I looked into this due to rust-lang/rust#102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue.

r? `@thomcc`
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 27, 2024
sync thread_local key conditions exactly with what the macro uses

This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`.

I don't think this should actually change anything, but seems better to be consistent?
I looked into this due to rust-lang/rust#102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue.

r? `@thomcc`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-thread-locals Area: Thread local storage (TLS) C-bug Category: This is a bug. O-macos Operating system: macOS
Projects
None yet
Development

No branches or pull requests

3 participants