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

thread 'rustc' panicked at 'Failed to get parent for DefId(0:3721 ~ std[c8fe]::panic[0]::{{impl}}[20])', src/librustc_middle/traits/specialization_graph.rs:46:52 #71127

Closed
bjorn3 opened this issue Apr 14, 2020 · 4 comments
Labels
A-specialization Area: Trait impl specialization C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@bjorn3
Copy link
Member

bjorn3 commented Apr 14, 2020

Steps to reproduce:

  1. Apply the patches at https://github.com/bjorn3/rustc_codegen_cranelift/blob/c03e824db78c83d2c5c37d37c45d2dcc964eca3f/patches to the standard library source.
  2. Compile it
error[E0432]: unresolved import `core::num::NonZeroI128`
  --> sysroot_src/src/libstd/num.rs:15:21
   |
15 | pub use core::num::{NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize};
   |                     ^^^^^^^^^^^
   |                     |
   |                     no `NonZeroI128` in `num`
   |                     help: a similar name exists in the module: `NonZeroI8`

error[E0432]: unresolved import `core::num::NonZeroU128`
  --> sysroot_src/src/libstd/num.rs:17:21
   |
17 | pub use core::num::{NonZeroU128, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize};
   |                     ^^^^^^^^^^^
   |                     |
   |                     no `NonZeroU128` in `num`
   |                     help: a similar name exists in the module: `NonZeroU8`

error[E0412]: cannot find type `AtomicI128` in module `atomic`
    --> sysroot_src/src/libstd/panic.rs:258:32
     |
258  | impl RefUnwindSafe for atomic::AtomicI128 {}
     |                                ^^^^^^^^^^ help: a struct with a similar name exists: `AtomicI16`
     | 
    ::: /home/bjorn/Documenten/cg_clif/build_sysroot/sysroot_src/src/libcore/sync/atomic.rs:1229:9
     |
1229 |         pub struct $atomic_type {
     |         ----------------------- similarly named struct `AtomicI16` defined here

error[E0412]: cannot find type `AtomicU128` in module `atomic`
    --> sysroot_src/src/libstd/panic.rs:277:32
     |
277  | impl RefUnwindSafe for atomic::AtomicU128 {}
     |                                ^^^^^^^^^^ help: a struct with a similar name exists: `AtomicU16`
     | 
    ::: /home/bjorn/Documenten/cg_clif/build_sysroot/sysroot_src/src/libcore/sync/atomic.rs:1229:9
     |
1229 |         pub struct $atomic_type {
     |         ----------------------- similarly named struct `AtomicU16` defined here

thread 'rustc' panicked at 'Failed to get parent for DefId(0:3721 ~ std[c8fe]::panic[0]::{{impl}}[20])', src/librustc_middle/traits/specialization_graph.rs:46:52
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1069
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1504
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:218
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:515
  12: rust_begin_unwind
             at src/libstd/panicking.rs:419
  13: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:373
  14: rustc_middle::traits::specialization_graph::Graph::parent::{{closure}}
  15: rustc_middle::traits::specialization_graph::Graph::parent
  16: <rustc_middle::traits::specialization_graph::Ancestors as core::iter::traits::iterator::Iterator>::next
  17: rustc_typeck::impl_wf_check::min_specialization::check_min_specialization
  18: <rustc_typeck::impl_wf_check::ImplWfCheck as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item
  19: rustc_middle::hir::map::Map::visit_item_likes_in_module
  20: rustc_typeck::impl_wf_check::check_mod_impl_wf
  21: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_mod_impl_wf>::compute
  22: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  23: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  24: rustc_query_system::query::plumbing::get_query
  25: rustc_query_system::query::plumbing::ensure_query
  26: rustc_typeck::impl_wf_check::impl_wf_check
  27: rustc_typeck::check_crate
  28: rustc_interface::passes::analysis
  29: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  30: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  31: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  32: rustc_query_system::query::plumbing::get_query
  33: rustc_middle::ty::context::tls::enter_global
  34: rustc_interface::interface::run_compiler_in_existing_thread_pool
  35: scoped_tls::ScopedKey<T>::set
  36: rustc_ast::attr::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.44.0-nightly (3712e11a8 2020-04-12) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z panic-abort-tests -Z codegen-backend=/home/bjorn/Documenten/cg_clif/target/release/librustc_codegen_cranelift.so -Z force-unstable-if-unmarked -C prefer-dynamic -C debuginfo=2 -C incremental -C linker=aarch64-linux-gnu-gcc -C panic=abort -C debuginfo=2 --crate-type dylib --crate-type rlib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [check_mod_impl_wf] checking that impls are well-formed in module `panic`
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors

(keep alive: bjorn3/rustc_codegen_cranelift@c03e824)

@bjorn3 bjorn3 added the C-bug Category: This is a bug. label Apr 14, 2020
@jonas-schievink jonas-schievink added A-specialization Area: Trait impl specialization E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 14, 2020
@steffahn
Copy link
Member

I'm having trouble reproducing this. Could you be more specific about what version of the standard library source to use and how exactly to compile it?

@lcnr
Copy link
Contributor

lcnr commented Jul 20, 2020

@bjorn3 I've fixed a similar bug in #74483, which had the same error (noticed by @JohnTitor), can you still reproduce this issue?

edit: sorry for pinging you @ bjorn

@bjorn3
Copy link
Member Author

bjorn3 commented Jul 20, 2020

can you still reproduce this issue?

I am pretty sure that the patches to libcore that reproduced this error no longer apply.

edit: sorry for pinging you @ bjorn

It's fine to ping me.

@lcnr
Copy link
Contributor

lcnr commented Jul 20, 2020

I originally pinged @ bjorn without the 3 at the end 😅

Hmm, then there isn't much to do here I think... will go ahead and close this as I expect #74516 to have fixed this

@lcnr lcnr closed this as completed Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-specialization Area: Trait impl specialization C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants