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' #3151

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

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

PSeitz opened this issue Sep 8, 2018 · 2 comments
Labels
I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@PSeitz
Copy link
Contributor

PSeitz commented Sep 8, 2018

Hi,
this code leads to a panic in a clippy lint:

#[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

Stacktrace:

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

This block seems to be the issue:
https://github.com/rust-lang-nursery/rust-clippy/blob/fdd830f52c082b83db0dac3e0066c0cf114050d2/clippy_lints/src/types.rs#L1811-L1816

Related, but seems to be a different error cause (no check_item in the stacktrace): #2306

@ghost
Copy link

ghost commented Sep 9, 2018

Playground link

@PSeitz
Copy link
Contributor Author

PSeitz commented Sep 9, 2018

I created a pull request for this issue #3152

@phansch phansch added the I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ label Sep 10, 2018
oli-obk added a commit that referenced this issue Sep 10, 2018
fixes #3151 by skipping the lint instead of crashing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants