racer-rust / emacs-racer

Racer support for Emacs
398 stars 48 forks source link

assertion failed: structmatch.mtype == core::MatchType::Struct #103

Closed indradhanush closed 6 years ago

indradhanush commented 6 years ago

Steps to reproduce the error

Invoke racer-find-definition on expect at this line: https://github.com/habitat-sh/habitat/blob/master/components/butterfly/src/trace.rs#L286

Here's the command that reproduces the error from the command line:

$ RUST_BACKTRACE=1 CARGO_HOME=/home/dhanush/.cargo RUST_SRC_PATH=/home/dhanush/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src ~/.cargo/bin/racer find-definition 286 49 /home/dhanush/kinvolk/chef/habitat/components/butterfly/src/trace.rs
thread 'main' panicked at 'assertion failed: structmatch.mtype == core::MatchType::Struct', src/racer/typeinf.rs:220:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:207
   3: std::panicking::default_hook
             at libstd/panicking.rs:223
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:402
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:365
   6: racer::typeinf::get_struct_field_type
             at src/racer/typeinf.rs:220
   7: <racer::ast::ExprTypeVisitor<'c, 's> as syntex_syntax::visit::Visitor>::visit_expr
             at src/racer/ast.rs:607
             at /checkout/src/libcore/option.rs:612
             at src/racer/ast.rs:603
   8: <racer::ast::ExprTypeVisitor<'c, 's> as syntex_syntax::visit::Visitor>::visit_expr
             at src/racer/ast.rs:575
   9: racer::ast::get_type_of
             at src/racer/ast.rs:1158
  10: racer::core::find_definition_
             at src/racer/core.rs:1194
  11: racer::core::find_definition
             at ./.cargo/registry/src/github.com-1ecc6299db9ec823/racer-2.0.14/src/racer/core.rs:1143
  12: racer::run
             at src/bin/main.rs:179
             at src/bin/main.rs:501
  13: racer::main
             at src/bin/main.rs:487
  14: std::rt::lang_start::{{closure}}
             at /checkout/src/libstd/rt.rs:74
  15: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:306
  16: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  17: std::rt::lang_start_internal
             at libstd/panicking.rs:285
             at libstd/panic.rs:361
             at libstd/rt.rs:58
  18: main
  19: __libc_start_main
  20: _start
Wilfred commented 6 years ago

Thanks for the report! I'm afraid this isn't a problem with emacs-racer, but with racer itself. Would you mind find filing a bug on https://github.com/phildawes/racer instead?

kngwyu commented 6 years ago

This is fixed in current master and next release(maybe in next week) includes it. But, this is really hard to reproduce so @indradhanush, really thank you for reporting.