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' panicked at 'failed to create span for type arguments' #54052

Closed
PSeitz opened this issue Sep 8, 2018 · 2 comments
Closed

'rustc' panicked at 'failed to create span for type arguments' #54052

PSeitz opened this issue Sep 8, 2018 · 2 comments

Comments

@PSeitz
Copy link
Contributor

PSeitz commented Sep 8, 2018

Hi,
this code leads to a panic in the compiler with cargo clippy:

#[derive(Clone)]
pub struct HashMap<V, S> {
    hash_builder: S,
    table: RawTable<V>,
}

#[derive(Clone)]
pub struct RawTable<V> {
    size: usize,
    val: V
}

I did put the code in a small repo:

  • git clone https://github.com/PSeitz/span_err
  • cargo clippy (I don't know how to see all compiler flags from clippy for the rustc command)

note: rustc 1.30.0-nightly (f8d3459 2018-08-30) running on x86_64-unknown-linux-gnu
note: compiler flags: -C debuginfo=2 -C incremental --crate-type lib

rustc 1.30.0-nightly (f8d34596f 2018-08-30)
binary: rustc
commit-hash: f8d34596ff74da91e0877212a9979cb9ca13eb7e
commit-date: 2018-08-30
host: x86_64-unknown-linux-gnu
release: 1.30.0-nightly
LLVM version: 7.0
@PSeitz
Copy link
Contributor Author

PSeitz commented Sep 8, 2018

Probably related: rust-lang/rust-clippy#2306

@PSeitz
Copy link
Contributor Author

PSeitz commented Sep 8, 2018

Edit I'll close this. By the stacktrace it seems to be cause by a clippy plugin:

thread 'rustc' panicked at 'failed to create span for type arguments', libcore/option.rs:1000:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
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:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:481
   6: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:391
   7: rust_begin_unwind
             at libstd/panicking.rs:326
   8: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   9: core::option::expect_failed
             at libcore/option.rs:1000
  10: <clippy_lints::types::ImplicitHasher as rustc::lint::LateLintPass<'a, 'tcx>>::check_item
  11: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  12: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  13: rustc::hir::intravisit::walk_crate
  14: rustc::lint::context::check_crate
  15: rustc::util::common::time
  16: rustc::ty::context::tls::enter_context
  17: <std::thread::local::LocalKey<T>>::with
  18: rustc::ty::context::TyCtxt::create_and_enter
  19: rustc_driver::driver::compile_input
  20: rustc_driver::run_compiler_with_pool
  21: <scoped_tls::ScopedKey<T>>::set
  22: rustc_driver::run_compiler
  23: <scoped_tls::ScopedKey<T>>::set

@PSeitz PSeitz closed this as completed Sep 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant