robinmoussu/cargo-callgraph

`cargo run test/example.rs` panics

jyn514 opened this issue · 2 comments

This is with the changes from #4.

$ RUST_BACKTRACE=1 cargo run test/example.rs
    Finished dev [unoptimized + debuginfo] target(s) in 0.67s
     Running `/home/joshua/.local/lib/cargo/target/debug/cargo-callgraph test/example.rs`
thread 'rustc' panicked at 'explicit panic', extract_dependencies.rs:490:54
stack backtrace:
   0: std::panicking::begin_panic
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/library/std/src/panicking.rs:519:12
   1: cargo_callgraph::extract_dependencies::extract_and_render_dependencies
             at ./extract_dependencies.rs:490:54
   2: cargo_callgraph::core::run_global_ctxt::{{closure}}
             at ./core.rs:539:27
   3: rustc_data_structures::profiling::VerboseTimingGuard::run
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_data_structures/src/profiling.rs:570:9
   4: rustc_session::utils::<impl rustc_session::session::Session>::time
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_session/src/utils.rs:9:9
   5: cargo_callgraph::core::run_global_ctxt
             at ./core.rs:536:5
   6: cargo_callgraph::core::run_core::{{closure}}::{{closure}}::{{closure}}::{{closure}}
             at ./core.rs:474:21
   7: rustc_interface::passes::QueryContext::enter::{{closure}}
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_interface/src/passes.rs:725:42
   8: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_middle/src/ty/context.rs:1739:50
   9: rustc_middle::ty::context::tls::set_tlv
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_middle/src/ty/context.rs:1723:9
  10: rustc_middle::ty::context::tls::enter_context
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_middle/src/ty/context.rs:1739:9
  11: rustc_interface::passes::QueryContext::enter
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_interface/src/passes.rs:725:9
  12: cargo_callgraph::core::run_core::{{closure}}::{{closure}}::{{closure}}
             at ./core.rs:473:17
  13: rustc_data_structures::profiling::VerboseTimingGuard::run
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_data_structures/src/profiling.rs:570:9
  14: rustc_session::utils::<impl rustc_session::session::Session>::time
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_session/src/utils.rs:9:9
  15: cargo_callgraph::core::run_core::{{closure}}::{{closure}}
             at ./core.rs:472:46
  16: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_interface/src/queries.rs:415:19
  17: cargo_callgraph::core::run_core::{{closure}}
             at ./core.rs:431:9
  18: rustc_interface::interface::create_compiler_and_run::{{closure}}
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_interface/src/interface.rs:196:13
  19: rustc_span::with_source_map
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_span/src/lib.rs:764:5
  20: rustc_interface::interface::create_compiler_and_run
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_interface/src/interface.rs:190:5
  21: cargo_callgraph::core::run_core
             at ./core.rs:430:5
  22: cargo_callgraph::main_options
             at ./lib.rs:584:53
  23: cargo_callgraph::main_args::{{closure}}
             at ./lib.rs:517:17
  24: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}::{{closure}}
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_interface/src/util.rs:152:13
  25: scoped_tls::ScopedKey<T>::set
             at /cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9
  26: rustc_span::with_session_globals
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_span/src/lib.rs:93:5
  27: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_interface/src/util.rs:150:9
  28: rustc_interface::util::scoped_thread::{{closure}}
             at /rustc/1c389ffeff814726dec325f0f2b0c99107df2673/compiler/rustc_interface/src/util.rs:125:24

fixed