Repository: rust
Issue:  internal compiler error: unexpected panic
Labels: O-linux,I-ICE,T-compiler,O-musl,C-bug,O-AArch64


Hi, Dear! I meet a bug, which said "internal compiler error: unexpected panic".

### Dockerfile
I tried to compile rust in my Dockerfile, and I run:

```Rust
RUN pip install --upgrade pip setuptools wheel
RUN curl --proto '=https' --tlsv1.2 https://sh.rustup.rs | sh -s -- --default-toolchain nightly -y

ENV PATH="/root/.cargo/bin:$PATH"

RUN echo $PATH
RUN pip install setuptools_rust
WORKDIR /opt/dialog/dialog/tokenizers/bindings/python/
RUN python setup.py install
```

### Environment
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

run 
```
uname -a
```
the system gives:
```
Linux dialog 5.4.17-2102.206.1.el8uek.aarch64 #2 SMP Wed Oct 6 17:35:01 PDT 2021 aarch64 aarch64 aarch64 GNU/Linux
```

### Error output

```
   Compiling bitvec v0.19.5
     Running `rustc --crate-name bitvec --edition=2018 /root/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.19.5/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="alloc"' --cfg 'feature="std"' -C metadata=e3ebe1c3d3ffb980 -C extra-filename=-e3ebe1c3d3ffb980 --out-dir /opt/dialog/dialog/tokenizers/bindings/python/target/release/deps -L dependency=/opt/dialog/dialog/tokenizers/bindings/python/target/release/deps --extern funty=/opt/dialog/dialog/tokenizers/bindings/python/target/release/deps/libfunty-eec1f3644ac03f22.rmeta --extern radium=/opt/dialog/dialog/tokenizers/bindings/python/target/release/deps/libradium-5cd26f7a0206fa7a.rmeta --extern tap=/opt/dialog/dialog/tokenizers/bindings/python/target/release/deps/libtap-46910ac139fe34a5.rmeta --extern wyz=/opt/dialog/dialog/tokenizers/bindings/python/target/release/deps/libwyz-665419bf94144d7a.rmeta --cap-lints allow -C target-feature=-crt-static`
thread '<unnamed>' panicked at 'cannot access a Thread Local Storage value during or after destruction: AccessError', library/std/src/thread/local.rs:375:26
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.58.0 (02072b482 2022-01-11) running on aarch64-unknown-linux-musl

note: compiler flags: -C prefer-dynamic -C embed-bitcode=no -C debug-assertions=off -C target-feature=-crt-static --crate-type proc-macro

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
thread '<unnamed>' panicked at 'cannot access a Thread Local Storage value during or after destruction: AccessError', library/std/src/thread/local.rs:375:26

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.58.0 (02072b482 2022-01-11) running on aarch64-unknown-linux-musl

note: compiler flags: -C prefer-dynamic -C embed-bitcode=no -C debug-assertions=off -C target-feature=-crt-static --crate-type proc-macro

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
fatal runtime error: failed to initiate panic, error 3476417056
error: could not compile `paste-impl`

Caused by:
  process didn't exit successfully: `rustc --crate-name paste_impl --edition=2018 /root/.cargo/registry/src/github.com-1ecc6299db9ec823/paste-impl-0.1.18/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C embed-bitcode=no -C debug-assertions=off -C metadata=0d5c9af24b253b8c -C extra-filename=-0d5c9af24b253b8c --out-dir /opt/dialog/dialog/tokenizers/bindings/python/target/release/deps -L dependency=/opt/dialog/dialog/tokenizers/bindings/python/target/release/deps --extern proc_macro_hack=/opt/dialog/dialog/tokenizers/bindings/python/target/release/deps/libproc_macro_hack-c4ed390bcb7fdc00.so --extern proc_macro --cap-lints allow -C target-feature=-crt-static` (signal: 6, SIGABRT: process abort signal)
warning: build failed, waiting for other jobs to finish...
error: build failed
error: cargo failed with code: 101

```


</details>
![image](https://user-images.githubusercontent.com/31400000/149602318-9cddeffc-4a89-49fc-8ee2-be0354ffc27a.png)

I don't know what's the problem, anyone could help me?
Thanks in advance!