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

ICE: assertion failure with -Zunpretty=mir-cfg #82325

Closed
matthiaskrgr opened this issue Feb 20, 2021 · 1 comment · Fixed by #82362
Closed

ICE: assertion failure with -Zunpretty=mir-cfg #82325

matthiaskrgr opened this issue Feb 20, 2021 · 1 comment · Fixed by #82362
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

code from glacier fixed/79666.rs

#![feature(const_generics)]
#![feature(generic_associated_types)]

trait A {
    type B<const N: usize>;

    fn foo<const N: usize>(&self) -> Self::B<{N}>;
}

fn main() {}

Meta

rustc --version --verbose:

rustc 1.52.0-nightly (9b471a3f5 2021-02-19)
binary: rustc
commit-hash: 9b471a3f5fe57e5c6e08acf665f2094422415a3d
commit-date: 2021-02-19
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 11.0.1

Error output

rustc ./79666.rs -Zunpretty=mir-cfg

warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
 --> ./79666.rs:1:12
  |
1 | #![feature(const_generics)]
  |            ^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information

warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
 --> ./79666.rs:2:12
  |
2 | #![feature(generic_associated_types)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information

thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `Some((DefId(0:8 ~ 79666[317d]::A::foo::{constant#0}), DefId(0:5 ~ 79666[317d]::A::B::N)))`,
 right: `None`', compiler/rustc_mir/src/transform/mod.rs:560:5
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.52.0-nightly (9b471a3f5 2021-02-19) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z unpretty=mir-cfg

query stack during panic:
#0 [optimized_mir] optimizing MIR for `A::foo::{constant#0}`
end of query stack
warning: 2 warnings emitted

Backtrace

warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
 --> ./79666.rs:1:12
  |
1 | #![feature(const_generics)]
  |            ^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information

warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
 --> ./79666.rs:2:12
  |
2 | #![feature(generic_associated_types)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information

thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `Some((DefId(0:8 ~ 79666[317d]::A::foo::{constant#0}), DefId(0:5 ~ 79666[317d]::A::B::N)))`,
 right: `None`', compiler/rustc_mir/src/transform/mod.rs:560:5
stack backtrace:
   0:     0x7f1178f35ab0 - std::backtrace_rs::backtrace::libunwind::trace::hb4de9797f80b7b8c
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7f1178f35ab0 - std::backtrace_rs::backtrace::trace_unsynchronized::h59566d0bd20efff7
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f1178f35ab0 - std::sys_common::backtrace::_print_fmt::hcfa5ce6be50275d4
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f1178f35ab0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd8c307a38b9bab04
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f1178fa6e6c - core::fmt::write::h3868db8542c90941
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/core/src/fmt/mod.rs:1092:17
   5:     0x7f1178f28992 - std::io::Write::write_fmt::hab90295d5a0f197d
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/std/src/io/mod.rs:1568:15
   6:     0x7f1178f399a5 - std::sys_common::backtrace::_print::h19224910b8700cf1
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f1178f399a5 - std::sys_common::backtrace::print::h25dedfa68c5fb84a
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f1178f399a5 - std::panicking::default_hook::{{closure}}::h12c5765653a72a42
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/std/src/panicking.rs:208:50
   9:     0x7f1178f39453 - std::panicking::default_hook::he65cee71c4209f0c
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/std/src/panicking.rs:225:9
  10:     0x7f117979808b - rustc_driver::report_ice::h56d5f6e6a9fb9d03
  11:     0x7f1178f3a2a6 - std::panicking::rust_panic_with_hook::h01a674d863fe0d8a
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/std/src/panicking.rs:595:17
  12:     0x7f1178f39dc7 - std::panicking::begin_panic_handler::{{closure}}::h9b9fecf185178864
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/std/src/panicking.rs:497:13
  13:     0x7f1178f35f4c - std::sys_common::backtrace::__rust_end_short_backtrace::h57be46a42dc7f24b
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/std/src/sys_common/backtrace.rs:141:18
  14:     0x7f1178f39d29 - rust_begin_unwind
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/std/src/panicking.rs:493:5
  15:     0x7f1178fa3491 - core::panicking::panic_fmt::h20225113c4a2f8fd
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/core/src/panicking.rs:92:14
  16:     0x7f117c15bf05 - rustc_mir::transform::optimized_mir::h245976003198d078
  17:     0x7f117975d5a3 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::optimized_mir>::compute::h962929d1c2186a42
  18:     0x7f1179790754 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h987bcc4d742b6eab
  19:     0x7f11797919ec - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task::h640404db930a6fbb
  20:     0x7f11797b5274 - rustc_data_structures::stack::ensure_sufficient_stack::hd389d807f70b11da
  21:     0x7f117975fa55 - rustc_query_system::query::plumbing::force_query_with_job::h4d36fcda7c0d6736
  22:     0x7f117975f060 - rustc_query_system::query::plumbing::get_query_impl::hff20e28a826798af
  23:     0x7f1179761ab1 - rustc_query_system::query::plumbing::get_query::h5f686cd74df0b95e
  24:     0x7f11797aa9a2 - rustc_mir::util::graphviz::write_mir_graphviz::he12cbf8a95c30fe6
  25:     0x7f117974d5e4 - rustc_driver::pretty::print_after_hir_lowering::h102b65afa3784540
  26:     0x7f117979f63e - rustc_interface::passes::QueryContext::enter::he206c0d61f6fb2e9
  27:     0x7f117bb0a6d7 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::hae97633c8f5175d4
  28:     0x7f117bb02e11 - rustc_span::with_source_map::hd16d211d24c668a9
  29:     0x7f117bb09c62 - scoped_tls::ScopedKey<T>::set::h08e96579ac07fec5
  30:     0x7f117bb0b448 - std::sys_common::backtrace::__rust_begin_short_backtrace::h84dc4b3263d56f8c
  31:     0x7f117bae9aba - core::ops::function::FnOnce::call_once{{vtable.shim}}::h209d27a00dc0b7e3
  32:     0x7f1178f4affa - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h321523073ee11258
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/alloc/src/boxed.rs:1546:9
  33:     0x7f1178f4affa - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf0e85e12c83b99b3
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/alloc/src/boxed.rs:1546:9
  34:     0x7f1178f4affa - std::sys::unix::thread::Thread::new::thread_start::hba22c7961aa0e2f8
                               at /rustc/9b471a3f5fe57e5c6e08acf665f2094422415a3d/library/std/src/sys/unix/thread.rs:71:17
  35:     0x7f1178e50299 - start_thread
  36:     0x7f1178d65153 - clone
  37:                0x0 - <unknown>

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.52.0-nightly (9b471a3f5 2021-02-19) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z unpretty=mir-cfg

query stack during panic:
#0 [optimized_mir] optimizing MIR for `A::foo::{constant#0}`
end of query stack
warning: 2 warnings emitted

@matthiaskrgr matthiaskrgr added C-bug Category: This is a bug. 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 Feb 20, 2021
@matthiaskrgr
Copy link
Member Author

@rustbot modify labels: requires-nightly

@rustbot rustbot added the requires-nightly This issue requires a nightly compiler in some way. label Feb 20, 2021
fanninpm added a commit to fanninpm/glacier that referenced this issue Feb 20, 2021
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Feb 21, 2021
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 22, 2021
Fix mir-cfg dumps

Fixes rust-lang#81918
Fixes rust-lang#82326 (duplicate)
Fixes rust-lang#82325

---

r? `@oli-obk`
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Feb 23, 2021
Fix mir-cfg dumps

Fixes rust-lang#81918
Fixes rust-lang#82326 (duplicate)
Fixes rust-lang#82325

---

r? ``@oli-obk``
@bors bors closed this as completed in 2145a87 Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants