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

Rustc panics (NoSolution): could not prove Binder(projection soup) #65581

tage64 opened this issue Oct 19, 2019 · 1 comment


Copy link

@tage64 tage64 commented Oct 19, 2019

I tried this code:

trait Trait1<T, U> {
    fn f1(self) -> U;

trait Trait2 {
    type T;
    type U: Trait2<T = Self::T>;
    fn f2(f: impl FnOnce(&Self::U));

fn f3<T: Trait2>() -> impl Trait1<T, T::T> {

struct Struct1;

impl<T: Trait2> Trait1<T, T::T> for Struct1 {
    fn f1(self) -> T::T {

fn f4<T: Trait2>() {
    T::f2(|_| {

I expected to see this happen: Rustc should either print an error message or compile my code.

Instead, this happened: Rustc panics.


rustc --version --verbose:
rustc 1.38.0 (625451e 2019-09-23)
binary: rustc
commit-hash: 625451e
commit-date: 2019-09-23
host: x86_64-unknown-linux-gnu
release: 1.38.0
LLVM version: 9.0

Put the above code in and execute:
RUST_BACKTRACE=1 rustc --crate-type=lib:

error: internal compiler error: broken MIR in DefId(0:31 ~ lib[8787]::f4[0]::{{closure}}[0]) (NoSolution): could not prove Binder(TraitPredicate(<impl Trait1<<T as Trait2>::U, <<T as Trait2>::U as Trait2>::T> as Trait1<<T as Trait2>::U, <T as Trait2>::T>>))

error: internal compiler error: broken MIR in DefId(0:31 ~ lib[8787]::f4[0]::{{closure}}[0]) (Terminator { source_info: SourceInfo { span: src/ 26:26, scope: scope[0] }, kind: _3 = const <impl Trait1<<T as Trait2>::U, <<T as Trait2>::U as Trait2>::T> as Trait1<<T as Trait2>::U, <<T as Trait2>::U as Trait2>::T>>::f1(move _4) -> [return: bb3, unwind: bb4] }): call dest mismatch (<<T as Trait2>::U as Trait2>::T <- <T as Trait2>::T): NoSolution
  --> src/
25 |       T::f2(|_| {
   |  ___________^
26 | |         f3::<T::U>().f1();
27 | |     });
   | |_____^

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/
   2: std::sys_common::backtrace::_print
             at src/libstd/sys_common/
   3: std::sys_common::backtrace::print
             at src/libstd/sys_common/
   4: std::panicking::default_hook::{{closure}}
             at src/libstd/
   5: std::panicking::default_hook
             at src/libstd/
   6: rustc::util::common::panic_hook
   7: std::panicking::rust_panic_with_hook
             at src/libstd/
   8: std::panicking::begin_panic
   9: <rustc_errors::Handler as core::ops::drop::Drop>::drop
  10: core::ptr::real_drop_in_place
  11: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
  12: core::ptr::real_drop_in_place
  13: rustc_interface::interface::run_compiler_in_existing_thread_pool
  14: std::thread::local::LocalKey<T>::with
  15: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
query stack during panic:
end of query stack

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report:

note: rustc 1.38.0 (625451e37 2019-09-23) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib

This comment has been minimized.

Copy link

@pnkfelix pnkfelix commented Oct 24, 2019

triage: P-high. Removing nomination label.

reasoning: ICE is pretty inscrutable, and there's no other error diagnostic, so this is a frustrating scenario for the end user. But removing nomination because there isn't really anything to discuss amongst team beyond the prioritization.

@pnkfelix pnkfelix added P-high and removed I-nominated labels Oct 24, 2019
@pnkfelix pnkfelix changed the title Rustc panics when compiling some code Rustc panics (NoSolution): could not prove Binder(projection soup) Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
5 participants
You can’t perform that action at this time.