Repository: rust
Issue: ICE while compiling crossbeam-epoch 0.9.15 with `-Zpolymorphize=on"`
Labels: I-ICE,T-compiler,C-bug,-Zpolymorphize

<!--
Thank you for finding an Internal Compiler Error! 🧊  If possible, try to provide
a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
how to create smaller examples.
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
-->

### Code

```
cargo new test-ice
cd test-ice
cargo add crossbeam-epoch:0.9.16
RUSTFLAGS="-Zpolymorphize=on" cargo build
```


### Meta
<!--
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.
-->

`rustc --version --verbose`:
```
rustc 1.76.0-nightly (21cce21d8 2023-12-11)
binary: rustc
commit-hash: 21cce21d8c012f14cf74d5afddd795d324600dac
commit-date: 2023-12-11
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5
```

### Error output

```
error: internal compiler error: compiler/rustc_monomorphize/src/collector.rs:792:50: collection encountered polymorphic constant: Unevaluated(UnevaluatedConst { def: DefId(0:86 ~ crossbeam_epoch[a06d]::atomic::Pointable::ALIGN), args: [T/#0], promoted: None }, usize)
   --> /home/weiznich/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.16/src/atomic.rs:106:11
    |
106 |     (1 << T::ALIGN.trailing_zeros()) - 1
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^


```

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>

```
thread 'rustc' panicked at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/compiler/rustc_errors/src/lib.rs:1027:33:
Box<dyn Any>
stack backtrace:
   0:     0x7f332a60745c - std::backtrace_rs::backtrace::libunwind::trace::h4f2e2566beda338b
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f332a60745c - std::backtrace_rs::backtrace::trace_unsynchronized::hbf03bd6948f7dbc1
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f332a60745c - std::sys_common::backtrace::_print_fmt::ha6e2eda21708f0da
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f332a60745c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hcf843684cf6299a2
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f332a65a510 - core::fmt::rt::Argument::fmt::h89315d2fe2ee9dc4
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/core/src/fmt/rt.rs:142:9
   5:     0x7f332a65a510 - core::fmt::write::hb09b769ada3054bb
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f332a5fb2bf - std::io::Write::write_fmt::h85f1f544036620f8
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/io/mod.rs:1810:15
   7:     0x7f332a607244 - std::sys_common::backtrace::_print::h2ce7ed0749d53a45
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f332a607244 - std::sys_common::backtrace::print::h472292a589b6d656
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f332a609f47 - std::panicking::default_hook::{{closure}}::h1e51eefb05ac2a81
  10:     0x7f332a609caf - std::panicking::default_hook::hb6cf57a99b8bfffd
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/panicking.rs:292:9
  11:     0x7f3327333150 - std[f551778c0f27cc6d]::panicking::update_hook::<alloc[dc008c177c6f77ab]::boxed::Box<rustc_driver_impl[6e9cf9b4eddc1f9a]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f332a60a688 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hcd18a368e1cefb08
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/alloc/src/boxed.rs:2029:9
  13:     0x7f332a60a688 - std::panicking::rust_panic_with_hook::h321aae92a11b5eba
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/panicking.rs:783:13
  14:     0x7f33279ca6f4 - std[f551778c0f27cc6d]::panicking::begin_panic::<rustc_errors[6f2fa450043bd5e]::ExplicitBug>::{closure#0}
  15:     0x7f33279c70a6 - std[f551778c0f27cc6d]::sys_common::backtrace::__rust_end_short_backtrace::<std[f551778c0f27cc6d]::panicking::begin_panic<rustc_errors[6f2fa450043bd5e]::ExplicitBug>::{closure#0}, !>
  16:     0x7f33279c42f6 - std[f551778c0f27cc6d]::panicking::begin_panic::<rustc_errors[6f2fa450043bd5e]::ExplicitBug>
  17:     0x7f33279bf42e - <rustc_errors[6f2fa450043bd5e]::HandlerInner>::span_bug::<rustc_span[7dad7e8a9e9d3081]::span_encoding::Span, alloc[dc008c177c6f77ab]::string::String>
  18:     0x7f33279bf258 - <rustc_errors[6f2fa450043bd5e]::Handler>::span_bug::<rustc_span[7dad7e8a9e9d3081]::span_encoding::Span, alloc[dc008c177c6f77ab]::string::String>
  19:     0x7f33279cb0cb - rustc_middle[4e60b7abb15d5233]::util::bug::opt_span_bug_fmt::<rustc_span[7dad7e8a9e9d3081]::span_encoding::Span>::{closure#0}
  20:     0x7f33279cb22a - rustc_middle[4e60b7abb15d5233]::ty::context::tls::with_opt::<rustc_middle[4e60b7abb15d5233]::util::bug::opt_span_bug_fmt<rustc_span[7dad7e8a9e9d3081]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f33279c70e8 - rustc_middle[4e60b7abb15d5233]::ty::context::tls::with_context_opt::<rustc_middle[4e60b7abb15d5233]::ty::context::tls::with_opt<rustc_middle[4e60b7abb15d5233]::util::bug::opt_span_bug_fmt<rustc_span[7dad7e8a9e9d3081]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f33279c49c4 - rustc_middle[4e60b7abb15d5233]::util::bug::span_bug_fmt::<rustc_span[7dad7e8a9e9d3081]::span_encoding::Span>
  23:     0x7f3326348442 - rustc_monomorphize[d53fd41cba5f0f77]::collector::collect_items_rec::{closure#0}
  24:     0x7f332958c21d - rustc_monomorphize[d53fd41cba5f0f77]::collector::collect_items_rec
  25:     0x7f332958c718 - rustc_monomorphize[d53fd41cba5f0f77]::collector::collect_items_rec
  26:     0x7f332958c718 - rustc_monomorphize[d53fd41cba5f0f77]::collector::collect_items_rec
  27:     0x7f332958c718 - rustc_monomorphize[d53fd41cba5f0f77]::collector::collect_items_rec
  28:     0x7f332958c718 - rustc_monomorphize[d53fd41cba5f0f77]::collector::collect_items_rec
  29:     0x7f332958c718 - rustc_monomorphize[d53fd41cba5f0f77]::collector::collect_items_rec
  30:     0x7f332958c718 - rustc_monomorphize[d53fd41cba5f0f77]::collector::collect_items_rec
  31:     0x7f332958c718 - rustc_monomorphize[d53fd41cba5f0f77]::collector::collect_items_rec
  32:     0x7f332958c718 - rustc_monomorphize[d53fd41cba5f0f77]::collector::collect_items_rec
  33:     0x7f332958c718 - rustc_monomorphize[d53fd41cba5f0f77]::collector::collect_items_rec
  34:     0x7f332958c718 - rustc_monomorphize[d53fd41cba5f0f77]::collector::collect_items_rec
  35:     0x7f332958c718 - rustc_monomorphize[d53fd41cba5f0f77]::collector::collect_items_rec
  36:     0x7f332958c718 - rustc_monomorphize[d53fd41cba5f0f77]::collector::collect_items_rec
  37:     0x7f3329587c6e - rustc_monomorphize[d53fd41cba5f0f77]::partitioning::collect_and_partition_mono_items
  38:     0x7f33295871d6 - rustc_query_impl[38c531b8cd3ba84f]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[38c531b8cd3ba84f]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4e60b7abb15d5233]::query::erase::Erased<[u8; 24usize]>>
  39:     0x7f332958719f - <rustc_query_impl[38c531b8cd3ba84f]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2} as core[d7d4a658e83ad6ec]::ops::function::FnOnce<(rustc_middle[4e60b7abb15d5233]::ty::context::TyCtxt, ())>>::call_once
  40:     0x7f3329586751 - rustc_query_system[73a1eee4aa9a5c9e]::query::plumbing::try_execute_query::<rustc_query_impl[38c531b8cd3ba84f]::DynamicConfig<rustc_query_system[73a1eee4aa9a5c9e]::query::caches::SingleCache<rustc_middle[4e60b7abb15d5233]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[38c531b8cd3ba84f]::plumbing::QueryCtxt, false>
  41:     0x7f3329586453 - rustc_query_impl[38c531b8cd3ba84f]::query_impl::collect_and_partition_mono_items::get_query_non_incr::__rust_end_short_backtrace
  42:     0x7f33291463a0 - rustc_codegen_ssa[e2f359916a741b11]::back::symbol_export::exported_symbols_provider_local
  43:     0x7f3329144f39 - rustc_query_impl[38c531b8cd3ba84f]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[38c531b8cd3ba84f]::query_impl::exported_symbols::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4e60b7abb15d5233]::query::erase::Erased<[u8; 16usize]>>
  44:     0x7f3329144f0f - <rustc_query_impl[38c531b8cd3ba84f]::query_impl::exported_symbols::dynamic_query::{closure#2} as core[d7d4a658e83ad6ec]::ops::function::FnOnce<(rustc_middle[4e60b7abb15d5233]::ty::context::TyCtxt, rustc_span[7dad7e8a9e9d3081]::def_id::CrateNum)>>::call_once
  45:     0x7f3329143152 - rustc_query_system[73a1eee4aa9a5c9e]::query::plumbing::try_execute_query::<rustc_query_impl[38c531b8cd3ba84f]::DynamicConfig<rustc_query_system[73a1eee4aa9a5c9e]::query::caches::VecCache<rustc_span[7dad7e8a9e9d3081]::def_id::CrateNum, rustc_middle[4e60b7abb15d5233]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[38c531b8cd3ba84f]::plumbing::QueryCtxt, false>
  46:     0x7f3329142ba1 - rustc_query_impl[38c531b8cd3ba84f]::query_impl::exported_symbols::get_query_non_incr::__rust_end_short_backtrace
  47:     0x7f3329142c4b - rustc_middle[4e60b7abb15d5233]::query::plumbing::query_get_at::<rustc_query_system[73a1eee4aa9a5c9e]::query::caches::VecCache<rustc_span[7dad7e8a9e9d3081]::def_id::CrateNum, rustc_middle[4e60b7abb15d5233]::query::erase::Erased<[u8; 16usize]>>>
  48:     0x7f33295cff86 - <rustc_metadata[982696aebedbca0]::rmeta::encoder::EncodeContext>::encode_crate_root
  49:     0x7f33295f7167 - rustc_metadata[982696aebedbca0]::rmeta::encoder::encode_metadata
  50:     0x7f33295f5928 - rustc_metadata[982696aebedbca0]::fs::encode_and_write_metadata
  51:     0x7f332937b880 - rustc_interface[b13791352229774c]::passes::start_codegen
  52:     0x7f332937b0ae - <rustc_interface[b13791352229774c]::queries::Queries>::codegen_and_build_linker
  53:     0x7f3329635c6d - rustc_interface[b13791352229774c]::interface::run_compiler::<core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>, rustc_driver_impl[6e9cf9b4eddc1f9a]::run_compiler::{closure#0}>::{closure#0}
  54:     0x7f33295aff4a - std[f551778c0f27cc6d]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[b13791352229774c]::util::run_in_thread_with_globals<rustc_interface[b13791352229774c]::util::run_in_thread_pool_with_globals<rustc_interface[b13791352229774c]::interface::run_compiler<core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>, rustc_driver_impl[6e9cf9b4eddc1f9a]::run_compiler::{closure#0}>::{closure#0}, core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>>::{closure#0}, core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>>
  55:     0x7f33295afd73 - <<std[f551778c0f27cc6d]::thread::Builder>::spawn_unchecked_<rustc_interface[b13791352229774c]::util::run_in_thread_with_globals<rustc_interface[b13791352229774c]::util::run_in_thread_pool_with_globals<rustc_interface[b13791352229774c]::interface::run_compiler<core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>, rustc_driver_impl[6e9cf9b4eddc1f9a]::run_compiler::{closure#0}>::{closure#0}, core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>>::{closure#0}, core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>>::{closure#1} as core[d7d4a658e83ad6ec]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  56:     0x7f332a614515 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb577b19a12e09868
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/alloc/src/boxed.rs:2015:9
  57:     0x7f332a614515 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8a3cf55554903b8d
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/alloc/src/boxed.rs:2015:9
  58:     0x7f332a614515 - std::sys::unix::thread::Thread::new::thread_start::hc928c4ba1b883694
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/sys/unix/thread.rs:108:17
  59:     0x7f33244ac897 - start_thread
  60:     0x7f33245336fc - clone3
  61:                0x0 - <unknown>

```

</p>
</details>

[rustc-ice-2023-12-13T14_36_11-313253.txt](https://github.com/rust-lang/rust/files/13661877/rustc-ice-2023-12-13T14_36_11-313253.txt)