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: Encountered error Unimplemented selecting `Binder(... issue-37725.rs --emit mir -Zmir-opt-level=2 #73021

Closed
matthiaskrgr opened this issue Jun 5, 2020 · 1 comment · Fixed by #96806
Labels
A-mir-opt Area: MIR optimizations A-mir-opt-inlining Area: MIR inlining 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) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

code from ./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

repo is @ 219380d

Error output

build/x86_64-unknown-linux-gnu/stage2/bin/rustc ./src/test/ui/issues/issue-37725.rs --emit mir -Zmir-opt-level=2

error: internal compiler error: src/librustc_trait_selection/traits/codegen/mod.rs:62: Encountered error `Unimplemented` selecting `Binder(<&mut () as Foo>)` during codegen

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:907:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.45.0-dev running on x86_64-unknown-linux-gnu

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

error: aborting due to previous error
Backtrace

error: internal compiler error: src/librustc_trait_selection/traits/codegen/mod.rs:62: Encountered error `Unimplemented` selecting `Binder(<&mut () as Foo>)` during codegen

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:907:9
stack backtrace:
   0:     0x7f854c392d57 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he2fbf5405bd3f46a
   1:     0x7f854c3dfa3d - core::fmt::write::h65255e7874586eb2
   2:     0x7f854c363b95 - std::io::Write::write_fmt::h3c49d63e356d89fe
   3:     0x7f854c36f980 - std::panicking::default_hook::{{closure}}::h6b88f05100c9e449
   4:     0x7f854c36f694 - std::panicking::default_hook::h57a663a807afe943
   5:     0x7f854dd278a3 - rustc_driver::report_ice::h34c4499908ba0b29
   6:     0x7f854c37006c - std::panicking::rust_panic_with_hook::haef04471b94d420c
   7:     0x7f8551e5a763 - std::panicking::begin_panic::h864c0841f11b0cc5
   8:     0x7f8551e693b0 - rustc_errors::HandlerInner::bug::hf4b00747a8046e38
   9:     0x7f8551e67c80 - rustc_errors::Handler::bug::h1a265be085905310
  10:     0x7f8551a00446 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::hc31214a436b0cba2
  11:     0x7f85519f80e5 - rustc_middle::ty::context::tls::with_opt::{{closure}}::h8a5fa3e61707645c
  12:     0x7f85519f804d - rustc_middle::ty::context::tls::with_opt::he95b2464f8e01c32
  13:     0x7f8551a00355 - rustc_middle::util::bug::opt_span_bug_fmt::h89c1337accb0a963
  14:     0x7f8551a002c0 - rustc_middle::util::bug::bug_fmt::h394875dd81e62801
  15:     0x7f85512e1063 - rustc_middle::ty::context::tls::with_context::{{closure}}::hcb597ad40f289ceb
  16:     0x7f85513c35b2 - rustc_trait_selection::traits::codegen::codegen_fulfill_obligation::h04afb560be6f50a0
  17:     0x7f854f948ce0 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::codegen_fulfill_obligation>::compute::h150cdd99437402d3
  18:     0x7f854f8fc84f - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h5d5de00aae599a9f
  19:     0x7f854f93a687 - rustc_data_structures::stack::ensure_sufficient_stack::h10ea4587daeba69c
  20:     0x7f854f9224ad - rustc_query_system::query::plumbing::get_query_impl::h869324ff800ba811
  21:     0x7f854f94ae65 - rustc_ty::instance::resolve_instance::h2a8891af4d35eb86
  22:     0x7f8551a0b1ef - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::resolve_instance>::compute::h04d053361670bbb5
  23:     0x7f8551805d75 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h3105f77cafdcd3ec
  24:     0x7f855198bf7b - rustc_data_structures::stack::ensure_sufficient_stack::he6771c1272790793
  25:     0x7f855184ca09 - rustc_query_system::query::plumbing::get_query_impl::h1a54d012f7ca9f66
  26:     0x7f85519fd95d - rustc_middle::ty::instance::Instance::resolve::h0c2d787267ba5284
  27:     0x7f85508af872 - rustc_mir::transform::inline::Inliner::run_pass::h007b6584e2f36079
  28:     0x7f85508af4e1 - <rustc_mir::transform::inline::Inline as rustc_mir::transform::MirPass>::run_pass::h71a943b5c1d2aa2f
  29:     0x7f85508b88ff - rustc_mir::transform::run_passes::h5cf0ebbe95e41c62
  30:     0x7f85508b9e76 - rustc_mir::transform::run_optimization_passes::h28cb849a160fe0ed
  31:     0x7f85508ba105 - rustc_mir::transform::optimized_mir::h0ca0c65ae05ae96c
  32:     0x7f855041866e - 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::hebf7317f3c2372c7
  33:     0x7f85507de617 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::he3935193a1ccaba5
  34:     0x7f85507546cf - rustc_query_system::query::plumbing::get_query_impl::{{closure}}::ha982673b78cb6e8d
  35:     0x7f85506f6562 - rustc_query_system::query::plumbing::get_query_impl::h5c8303c00395eac9
  36:     0x7f8550464c66 - rustc_mir::util::pretty::write_mir_pretty::h93c9145185ddab0f
  37:     0x7f8550960c23 - rustc_mir::transform::dump_mir::emit_mir::h514eb69ae7eaa045
  38:     0x7f854dee5604 - rustc_interface::passes::start_codegen::h64d9c511ec596bff
  39:     0x7f854df136d2 - rustc_middle::ty::context::tls::enter_global::hd5d9719ecc10b8ad
  40:     0x7f854df0977e - rustc_interface::queries::Queries::ongoing_codegen::h5a481c30c4739353
  41:     0x7f854dd35a0b - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h46a369817e38d2d4
  42:     0x7f854dd9f7ca - rustc_span::with_source_map::ha1e1d15982d868c1
  43:     0x7f854dd37b49 - rustc_interface::interface::run_compiler_in_existing_thread_pool::hfd5622ef3ce026be
  44:     0x7f854dd1134e - scoped_tls::ScopedKey<T>::set::hd3c1397285b10bd3
  45:     0x7f854dd38576 - std::sys_common::backtrace::__rust_begin_short_backtrace::h3df4554cf04b61c9
  46:     0x7f854dd0517e - core::ops::function::FnOnce::call_once{{vtable.shim}}::hb0a109416f61afc2
  47:     0x7f854c377d7a - std::sys::unix::thread::Thread::new::thread_start::hb2effada6f868308
  48:     0x7f854c09e422 - start_thread
  49:     0x7f854c1bcbf3 - __GI___clone
  50:                0x0 - <unknown>

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.45.0-dev running on x86_64-unknown-linux-gnu

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

query stack during panic:
#0 [codegen_fulfill_obligation] checking if `Foo` fulfills its obligations
#1 [resolve_instance] resolving instance `<&mut () as Foo>::foo`
#2 [optimized_mir] optimizing MIR for `foo`
end of query stack
error: aborting due to previous error

@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 Jun 5, 2020
@jonas-schievink jonas-schievink added the A-mir-opt Area: MIR optimizations label Jun 5, 2020
@wesleywiser wesleywiser added the A-mir-opt-inlining Area: MIR inlining label Jun 8, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Jun 17, 2020
@tesuji
Copy link
Contributor

tesuji commented Aug 27, 2020

#75961 has MCVE and doesn't require -Zmir-opt-level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations A-mir-opt-inlining Area: MIR inlining 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) ❄️ 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.

5 participants