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: issue-37725.rs -Zmir-opt-level=2 --emit mir #77669

Closed
matthiaskrgr opened this issue Oct 7, 2020 · 1 comment
Closed

ICE: issue-37725.rs -Zmir-opt-level=2 --emit mir #77669

matthiaskrgr opened this issue Oct 7, 2020 · 1 comment
Labels
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.

Comments

@matthiaskrgr
Copy link
Member

interestingly this one only crashes with -Zmir-opt-level=2 AND --emit mir

Code

./src/test/ui/issues/issue-37725.rs

// build-pass
#![allow(dead_code)]
trait Foo {
    fn foo(&self);
}

fn foo<'a>(s: &'a mut ()) where &'a mut (): Foo {
    s.foo();
}
fn main() {}

Meta

rustc --version --verbose:

rustc 1.49.0-nightly (98edd1fbf 2020-10-06)
binary: rustc
commit-hash: 98edd1fbf8a68977a2a7c1312eb1ebff80515a92
commit-date: 2020-10-06
host: x86_64-unknown-linux-gnu
release: 1.49.0-nightly
LLVM version: 11.0

Error output

error: internal compiler error: Encountered error `Unimplemented` selecting `Binder(<&mut () as Foo>)` during codegen
  |
  = note: delayed at compiler/rustc_trait_selection/src/traits/codegen/mod.rs:65:32

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:961:13
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.49.0-nightly (98edd1fbf 2020-10-06) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z mir-opt-level=2

Backtrace

error: internal compiler error: Encountered error `Unimplemented` selecting `Binder(<&mut () as Foo>)` during codegen
  |
  = note: delayed at compiler/rustc_trait_selection/src/traits/codegen/mod.rs:65:32

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:961:13
stack backtrace:
   0:     0x7fdf59d2b0b0 - std::backtrace_rs::backtrace::libunwind::trace::h622bab51c72c4e69
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
   1:     0x7fdf59d2b0b0 - std::backtrace_rs::backtrace::trace_unsynchronized::h7e820b882ebd41ee
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/../../backtrace/src/backtrace/mod.rs:66
   2:     0x7fdf59d2b0b0 - std::sys_common::backtrace::_print_fmt::h64d46258114db92f
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:79
   3:     0x7fdf59d2b0b0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h47111d0c1b5f0da5
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:58
   4:     0x7fdf59d9a07c - core::fmt::write::h1857a60b204f1b6a
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/core/src/fmt/mod.rs:1080
   5:     0x7fdf59d1d052 - std::io::Write::write_fmt::h4604516fed3e5731
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/io/mod.rs:1516
   6:     0x7fdf59d2fe7d - std::sys_common::backtrace::_print::h785e7a78d5ef272c
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:61
   7:     0x7fdf59d2fe7d - std::sys_common::backtrace::print::h108047ac5c4555d5
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:48
   8:     0x7fdf59d2fe7d - std::panicking::default_hook::{{closure}}::h1d0c271f0d087ebf
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:208
   9:     0x7fdf59d2fb28 - std::panicking::default_hook::h692753e26f11b7b7
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:227
  10:     0x7fdf5a5bd3e8 - rustc_driver::report_ice::h767ab601e5f63209
  11:     0x7fdf59d306c6 - std::panicking::rust_panic_with_hook::h74ddc20305301cd9
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:581
  12:     0x7fdf59d30249 - std::panicking::begin_panic_handler::{{closure}}::h1a9ca6427ceee1d0
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:484
  13:     0x7fdf59d2b54c - std::sys_common::backtrace::__rust_end_short_backtrace::h97e27b7ab754adde
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:153
  14:     0x7fdf59d30209 - rust_begin_unwind
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:483
  15:     0x7fdf59d301bb - std::panicking::begin_panic_fmt::h45d0f154d1dd3395
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:437
  16:     0x7fdf5d5d9281 - rustc_errors::HandlerInner::flush_delayed::h4e44ea29efc5a508
  17:     0x7fdf5d5d5be1 - <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop::hc2218eb325dc8425
  18:     0x7fdf5a60ad76 - core::ptr::drop_in_place::he652386dc31d9e30
  19:     0x7fdf5a60cbc6 - <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop::h60c7e2432b201062
  20:     0x7fdf5a5e66fd - core::ptr::drop_in_place::h2f4d4236293b18c7
  21:     0x7fdf5a5e0dea - rustc_span::with_source_map::h23e56868796f6dc3
  22:     0x7fdf5a615ed2 - rustc_interface::interface::create_compiler_and_run::h9a8debbb19483b80
  23:     0x7fdf5a5f4d0a - scoped_tls::ScopedKey<T>::set::hacc47b1cdb25a215
  24:     0x7fdf5a618611 - std::sys_common::backtrace::__rust_begin_short_backtrace::h3d5db7946c19f316
  25:     0x7fdf5a59618e - core::ops::function::FnOnce::call_once{{vtable.shim}}::he1a30fa4d30a2178
  26:     0x7fdf59d3efda - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h588ce842808b3fd0
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/alloc/src/boxed.rs:1042
  27:     0x7fdf59d3efda - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h46bc655f05471a92
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/alloc/src/boxed.rs:1042
  28:     0x7fdf59d3efda - std::sys::unix::thread::Thread::new::thread_start::hb4b79d379b730058
                               at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys/unix/thread.rs:87
  29:     0x7fdf59c3b3e9 - start_thread
  30:     0x7fdf59b58293 - __GI___clone
  31:                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.49.0-nightly (98edd1fbf 2020-10-06) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z mir-opt-level=2

query stack during panic:
end of query stack

@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 Oct 7, 2020
@matthiaskrgr
Copy link
Member Author

oops, dupe of #73021

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. 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

1 participant