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

error: internal compiler error: src/librustc/ty/context.rs:248 "node {} with HirId::owner {:?} cannot be placed in TypeckTables with local_id_root {:?}" #57298

Closed
ghost opened this issue Jan 3, 2019 · 19 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.

Comments

@ghost
Copy link

ghost commented Jan 3, 2019

EDIT3: ignore everything(to save time) and skip directly to this comment for this ICE reproduction steps.
EDIT2: this is probably already fixed nope! To reproduce the ICE currently, you have to do this because rust-clippy worked around it.
EDIT: ICE only happens when rustc has been compiled with debug-assertions = true

After successfully compiling rust-clippy HEAD with this rustc HEAD, running rust-clippy on itself causes an ICE like so:

/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy 
$ RUST_BACKTRACE=1 ./target/debug/cargo-clippy
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo' in pwd='/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy' with args: 'check'
    Checking unicode-normalization v0.1.7
    Checking itertools v0.7.8
    Checking regex-syntax v0.6.2
    Checking serde v1.0.80
error: internal compiler error: src/librustc/ty/context.rs:248: node type Result<T, Option<T>> (id=19954) with HirId::owner DefId(0/0:744 ~ itertools[656b]::Itertools[0]::tree_fold1[0]::State[0]) cannot be placed in TypeckTables with local_id_root DefId(0/0:743 ~ itertools[656b]::Itertools[0]::tree_fold1[0])

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:590:9
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
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::bug_fmt
  14: rustc::ty::context::validate_hir_id_for_typeck_tables::{{closure}}
  15: rustc::ty::context::tls::with::{{closure}}
  16: rustc::ty::context::tls::with_context::{{closure}}
  17: rustc::ty::context::tls::with_context_opt
  18: rustc::ty::context::tls::with_context
  19: rustc::ty::context::tls::with
  20: rustc::ty::context::TypeckTables::node_id_to_type_opt
  21: <clippy_lints::random_state::Pass as rustc::lint::LateLintPass<'a, 'tcx>>::check_ty
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/random_state.rs:38
  22: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_ty
  23: rustc::hir::intravisit::walk_item
  24: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  25: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  26: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_decl
  27: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_stmt
  28: rustc::hir::intravisit::walk_block
  29: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_block
  30: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  31: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
  32: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_body
  33: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_nested_body
  34: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_fn
  35: rustc::hir::intravisit::walk_trait_item
  36: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  37: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_trait_item
  38: rustc::hir::intravisit::walk_trait_item_ref
  39: rustc::hir::intravisit::walk_item
  40: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  41: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  42: rustc::hir::intravisit::walk_mod
  43: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  44: rustc::hir::intravisit::walk_crate
  45: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  46: rustc::lint::context::check_crate
  47: rustc::util::common::time
  48: <std::thread::local::LocalKey<T>>::with
  49: rustc::ty::context::tls::enter_global
  50: rustc::ty::context::TyCtxt::create_and_enter
  51: rustc_driver::driver::phase_3_run_analysis_passes
  52: rustc_driver::driver::compile_input
  53: rustc_driver::run_compiler_with_pool
  54: <scoped_tls::ScopedKey<T>>::set
  55: rustc_driver::driver::spawn_thread_pool
  56: rustc_driver::run_compiler
  57: clippy_driver::main::{{closure}}
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/src/driver.rs:154
  58: rustc_driver::run::{{closure}}::{{closure}}
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/src/librustc_driver/lib.rs:170
  59: <scoped_tls::ScopedKey<T>>::set
             at /home/xftroxgpx/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:155
  60: syntax::with_globals::{{closure}}
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/src/libsyntax/lib.rs:113
  61: <scoped_tls::ScopedKey<T>>::set
             at /home/xftroxgpx/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:155
  62: syntax::with_globals
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/src/libsyntax/lib.rs:112
  63: rustc_driver::run::{{closure}}
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/src/librustc_driver/lib.rs:169
  64: rustc_driver::monitor::{{closure}}
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/src/librustc_driver/lib.rs:1566
query stack during panic:
end of query stack
error: aborting due to previous error


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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.33.0-dev (ec194646f 2019-01-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `itertools`.
warning: build failed, waiting for other jobs to finish...
error: internal compiler error: src/librustc/ty/context.rs:248: node type &'static [(char, char)] (id=26257) with HirId::owner DefId(0/0:621 ~ regex_syntax[bb8f]::hir[0]::translate[0]::ascii_class[0]::T[0]) cannot be placed in TypeckTables with local_id_root DefId(0/0:619 ~ regex_syntax[bb8f]::hir[0]::translate[0]::ascii_class[0])

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:590:9
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
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::bug_fmt
  14: rustc::ty::context::validate_hir_id_for_typeck_tables::{{closure}}
  15: rustc::ty::context::tls::with::{{closure}}
  16: rustc::ty::context::tls::with_context::{{closure}}
  17: rustc::ty::context::tls::with_context_opt
  18: rustc::ty::context::tls::with_context
  19: rustc::ty::context::tls::with
  20: rustc::ty::context::TypeckTables::node_id_to_type_opt
  21: <clippy_lints::random_state::Pass as rustc::lint::LateLintPass<'a, 'tcx>>::check_ty
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/random_state.rs:38
  22: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_ty
  23: rustc::hir::intravisit::walk_item
  24: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  25: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  26: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_decl
  27: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_stmt
  28: rustc::hir::intravisit::walk_block
  29: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_block
  30: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  31: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
  32: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_body
  33: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_nested_body
  34: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_fn
  35: rustc::hir::intravisit::walk_item
  36: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  37: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  38: rustc::hir::intravisit::walk_mod
  39: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  40: rustc::hir::intravisit::walk_item
  41: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  42: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  43: rustc::hir::intravisit::walk_mod
  44: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  45: rustc::hir::intravisit::walk_item
  46: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  47: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  48: rustc::hir::intravisit::walk_mod
  49: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  50: rustc::hir::intravisit::walk_crate
  51: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  52: rustc::lint::context::check_crate
  53: rustc::util::common::time
  54: <std::thread::local::LocalKey<T>>::with
  55: rustc::ty::context::tls::enter_global
  56: rustc::ty::context::TyCtxt::create_and_enter
  57: rustc_driver::driver::phase_3_run_analysis_passes
  58: rustc_driver::driver::compile_input
  59: rustc_driver::run_compiler_with_pool
  60: <scoped_tls::ScopedKey<T>>::set
  61: rustc_driver::driver::spawn_thread_pool
  62: rustc_driver::run_compiler
  63: clippy_driver::main::{{closure}}
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/src/driver.rs:154
  64: rustc_driver::run::{{closure}}::{{closure}}
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/src/librustc_driver/lib.rs:170
  65: <scoped_tls::ScopedKey<T>>::set
             at /home/xftroxgpx/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:155
  66: syntax::with_globals::{{closure}}
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/src/libsyntax/lib.rs:113
  67: <scoped_tls::ScopedKey<T>>::set
             at /home/xftroxgpx/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:155
  68: syntax::with_globals
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/src/libsyntax/lib.rs:112
  69: rustc_driver::run::{{closure}}
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/src/librustc_driver/lib.rs:169
  70: rustc_driver::monitor::{{closure}}
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/src/librustc_driver/lib.rs:1566
query stack during panic:
end of query stack
error: aborting due to previous error


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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.33.0-dev (ec194646f 2019-01-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `regex-syntax`.
warning: build failed, waiting for other jobs to finish...
error: internal compiler error: src/librustc/ty/context.rs:248: node type PrimitiveVisitor (id=78333) with HirId::owner DefId(0/0:2831 ~ serde[2a2a]::de[0]::impls[0]::{{impl}}[39]::deserialize[0]::{{impl}}[0]) cannot be placed in TypeckTables with local_id_root DefId(0/0:2829 ~ serde[2a2a]::de[0]::impls[0]::{{impl}}[39]::deserialize[0])

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:590:9
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
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::bug_fmt
  14: rustc::ty::context::validate_hir_id_for_typeck_tables::{{closure}}
  15: rustc::ty::context::tls::with::{{closure}}
  16: rustc::ty::context::tls::with_context::{{closure}}
  17: rustc::ty::context::tls::with_context_opt
  18: rustc::ty::context::tls::with_context
  19: rustc::ty::context::tls::with
  20: rustc::ty::context::TypeckTables::node_id_to_type_opt
  21: <clippy_lints::random_state::Pass as rustc::lint::LateLintPass<'a, 'tcx>>::check_ty
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/random_state.rs:38
  22: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_ty
  23: rustc::hir::intravisit::walk_item
  24: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  25: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  26: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_decl
  27: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_stmt
  28: rustc::hir::intravisit::walk_block
  29: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_block
  30: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  31: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
  32: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_body
  33: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_nested_body
  34: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_fn
  35: rustc::hir::intravisit::walk_impl_item
  36: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  37: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_impl_item
  38: rustc::hir::intravisit::walk_impl_item_ref
  39: rustc::hir::intravisit::walk_item
  40: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  41: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  42: rustc::hir::intravisit::walk_mod
  43: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  44: rustc::hir::intravisit::walk_item
  45: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  46: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  47: rustc::hir::intravisit::walk_mod
  48: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  49: rustc::hir::intravisit::walk_item
  50: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  51: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  52: rustc::hir::intravisit::walk_mod
  53: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  54: rustc::hir::intravisit::walk_crate
  55: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  56: rustc::lint::context::check_crate
  57: rustc::util::common::time
  58: <std::thread::local::LocalKey<T>>::with
  59: rustc::ty::context::tls::enter_global
  60: rustc::ty::context::TyCtxt::create_and_enter
  61: rustc_driver::driver::phase_3_run_analysis_passes
  62: rustc_driver::driver::compile_input
  63: rustc_driver::run_compiler_with_pool
  64: <scoped_tls::ScopedKey<T>>::set
  65: rustc_driver::driver::spawn_thread_pool
  66: rustc_driver::run_compiler
  67: clippy_driver::main::{{closure}}
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/src/driver.rs:154
  68: rustc_driver::run::{{closure}}::{{closure}}
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/src/librustc_driver/lib.rs:170
  69: <scoped_tls::ScopedKey<T>>::set
             at /home/xftroxgpx/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:155
  70: syntax::with_globals::{{closure}}
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/src/libsyntax/lib.rs:113
  71: <scoped_tls::ScopedKey<T>>::set
             at /home/xftroxgpx/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:155
  72: syntax::with_globals
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/src/libsyntax/lib.rs:112
  73: rustc_driver::run::{{closure}}
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/src/librustc_driver/lib.rs:169
  74: rustc_driver::monitor::{{closure}}
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/src/librustc_driver/lib.rs:1566
query stack during panic:
end of query stack
error: aborting due to previous error


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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.33.0-dev (ec194646f 2019-01-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `serde`.
warning: build failed, waiting for other jobs to finish...
error: build failed

Meta

I used this config.toml when I compiled rustc.

$ rustc -vV
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build//x86_64-unknown-linux-gnu/stage2/bin//rustc' in pwd='/home/xftroxgpx' with args: '-vV'
rustc 1.33.0-dev (ec194646f 2019-01-02)
binary: rustc
commit-hash: ec194646fef1a467073ad74b8b68f6f202cfce97
commit-date: 2019-01-02
host: x86_64-unknown-linux-gnu
release: 1.33.0-dev
LLVM version: 8.0

$ cargo -vV
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo' in pwd='/home/xftroxgpx' with args: '-vV'
cargo 1.33.0-dev (6e10374b 2019-01-02)
release: 1.33.0
commit-hash: 6e10374b0bceccd6e9de8af0114524337b89a58d
commit-date: 2019-01-02

I'm on ArchLinux x86_64.

Maybe it's something I did, and it's not rustc's or even clippy's fault.

@estebank estebank added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. labels Jan 3, 2019
@mati865
Copy link
Contributor

mati865 commented Jan 4, 2019

It's being tracked in rust-lang/rust-clippy#3629

bors added a commit to rust-lang/rust-clippy that referenced this issue Jan 4, 2019
…hansch

Add itertools to integration tests

Mainly because it causes an ICE in rust-lang/rust#57298
and it's a good library to test anyway.
@ghost
Copy link
Author

ghost commented Jan 4, 2019

Ok, so I wanted to say the following(and close the issue) but I'm now no longer sure... but instead of deleting all this text and not posting this, i am posting it, but I'm not closing the issue. So consider this undeleted :D

I've since updated and recompiled rustc with a changed config.toml setting namely debug-assertions = false (was true before, in OP), and I'm no longer hitting this ICE, with latest rust-clippy commit(possibly due to mitigations ?)

I've tried using the same commit of rust-clippy from OP but I got other errors(that got fixed by a later commit), so I decided to just use latest commit which was: 8ac411dd42c6612b3184d305f9426e7e364cb211

$ rustc -vV
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build//x86_64-unknown-linux-gnu/stage2/bin//rustc' in pwd='/home/xftroxgpx' with args: '-vV'
rustc 1.33.0-dev (a602f13f0 2019-01-04)
binary: rustc
commit-hash: a602f13f02acc17eda0d7f2c2d9adeabbdb59cf4
commit-date: 2019-01-04
host: x86_64-unknown-linux-gnu
release: 1.33.0-dev
LLVM version: 8.0

$ cargo -Vv
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo' in pwd='/home/xftroxgpx' with args: '-Vv'
cargo 1.33.0-dev (34320d21 2019-01-03)
release: 1.33.0
commit-hash: 34320d212dca8cd27d06ce93c16c6151f46fcf2e
commit-date: 2019-01-03
/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy 
$ time cargo install --path . --force
...
    Finished release [optimized] target(s) in 8m 40s
   Replacing /home/xftroxgpx/.cargo/bin/cargo-clippy
   Replacing /home/xftroxgpx/.cargo/bin/clippy-driver

real	8m40.501s
user	24m2.846s
sys	0m11.862s

/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy 
$ time ./target/release/cargo-clippy 
...
    Finished dev [unoptimized + debuginfo] target(s) in 7m 53s

real	7m54.015s
user	20m18.805s
sys	0m20.590s

/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy 
$ cargo test --release -- --test-threads 4
...
    Finished release [optimized] target(s) in 7m 39s
     Running target/release/deps/compile_test-9cf56f1de0290b37

running 1 test

running 30 tests
test [run-pass] run-pass/ice-1588.rs ... ok
test [run-pass] run-pass/cc_seme.rs ... ok
test [run-pass] run-pass/enum-glob-import-crate.rs ... ok
test [run-pass] run-pass/associated-constant-ice.rs ... ok
test [run-pass] run-pass/ice-1969.rs ... ok
test [run-pass] run-pass/ice-1782.rs ... ok
test [run-pass] run-pass/ice-2499.rs ... ok
test [run-pass] run-pass/ice-2594.rs ... ok
test [run-pass] run-pass/ice-2727.rs ... ok
test [run-pass] run-pass/ice-2760.rs ... ok
test [run-pass] run-pass/ice-2865.rs ... ok
test [run-pass] run-pass/ice-2774.rs ... ok
test [run-pass] run-pass/ice-3462.rs ... ok
test [run-pass] run-pass/ice-3151.rs ... ok
test [run-pass] run-pass/ice-700.rs ... ok
test [run-pass] run-pass/ice_exacte_size.rs ... ok
test [run-pass] run-pass/if_same_then_else.rs ... ok
test [run-pass] run-pass/issue-2862.rs ... ok
test [run-pass] run-pass/issue-825.rs ... ok
test [run-pass] run-pass/issues_loop_mut_cond.rs ... ok
test [run-pass] run-pass/match_same_arms_const.rs ... ok
test [run-pass] run-pass/mut_mut_macro.rs ... ok
test [run-pass] run-pass/needless_borrow_fp.rs ... ok
test [run-pass] run-pass/needless_lifetimes_impl_trait.rs ... ok
test [run-pass] run-pass/procedural_macro.rs ... ok
test [run-pass] run-pass/regressions.rs ... ok
test [run-pass] run-pass/used_underscore_binding_macro.rs ... FAILED
test [run-pass] run-pass/returns.rs ... ok
test [run-pass] run-pass/single-match-else.rs ... ok
test [run-pass] run-pass/whitelist/conf_whitelisted.rs ... ok

failures:

---- [run-pass] run-pass/used_underscore_binding_macro.rs stdout ----

error: compilation failed!
status: exit code: 1
command: "target/release/clippy-driver" "tests/run-pass/used_underscore_binding_macro.rs" "-L" "/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/test_build_base" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-C" "prefer-dynamic" "-o" "/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/test_build_base/used_underscore_binding_macro.stage-id" "-L" "target/release" "-L" "target/release/deps" "-Dwarnings" "-Zui-testing" "-L" "/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/test_build_base/used_underscore_binding_macro.stage-id.aux"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
{"message":"multiple matching crates for `serde_derive`","code":{"code":"E0464","explanation":null},"level":"error","spans":[{"file_name":"tests/run-pass/used_underscore_binding_macro.rs","byte_start":543,"byte_end":569,"line_start":14,"line_end":14,"column_start":1,"column_end":27,"is_primary":true,"text":[{"text":"extern crate serde_derive;","highlight_start":1,"highlight_end":27}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"candidates:\ncrate `serde_derive`: /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libserde_derive-3f71afdce6a2028c.so\ncrate `serde_derive`: /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libserde_derive-17bc36f26561caa5.so","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0464]: multiple matching crates for `serde_derive`\n  --> tests/run-pass/used_underscore_binding_macro.rs:14:1\n   |\nLL | extern crate serde_derive;\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: candidates:\n           crate `serde_derive`: /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libserde_derive-3f71afdce6a2028c.so\n           crate `serde_derive`: /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libserde_derive-17bc36f26561caa5.so\n\n"}
{"message":"can't find crate for `serde_derive`","code":{"code":"E0463","explanation":"\nA plugin/crate was declared but cannot be found. Erroneous code example:\n\n```compile_fail,E0463\n#![feature(plugin)]\n#![plugin(cookie_monster)] // error: can't find crate for `cookie_monster`\nextern crate cake_is_a_lie; // error: can't find crate for `cake_is_a_lie`\n```\n\nYou need to link your code to the relevant crate in order to be able to use it\n(through Cargo or the `-L` option of rustc example). Plugins are crates as\nwell, and you link to them the same way.\n"},"level":"error","spans":[{"file_name":"tests/run-pass/used_underscore_binding_macro.rs","byte_start":543,"byte_end":569,"line_start":14,"line_end":14,"column_start":1,"column_end":27,"is_primary":true,"text":[{"text":"extern crate serde_derive;","highlight_start":1,"highlight_end":27}],"label":"can't find crate","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0463]: can't find crate for `serde_derive`\n  --> tests/run-pass/used_underscore_binding_macro.rs:14:1\n   |\nLL | extern crate serde_derive;\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate\n\n"}
{"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
{"message":"Some errors occurred: E0463, E0464.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0463, E0464.\n"}
{"message":"For more information about an error, try `rustc --explain E0463`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0463`.\n"}

------------------------------------------

thread '[run-pass] run-pass/used_underscore_binding_macro.rs' panicked at 'explicit panic', /home/xftroxgpx/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.18/src/runtest.rs:2632:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.


failures:
    [run-pass] run-pass/used_underscore_binding_macro.rs

test result: FAILED. 29 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

test compile_test ... FAILED

failures:

---- compile_test stdout ----
thread 'compile_test' panicked at 'Some tests failed', /home/xftroxgpx/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.18/src/lib.rs:90:22


failures:
    compile_test

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '--test compile-test'

I guess I can close this now, unless someone thinks this ICE can happen in cases unrelated to rust-clippy, or that it happens only when debug-assertions = true ?

EDIT: ok I even tested an earlier clippy commit 756b32e1e2ad474097f8d3e510b319dd5023297d to still not ICE, therefore it must be that debug-assertions = true when the ICE happens.

@mati865
Copy link
Contributor

mati865 commented Jan 4, 2019

@xftroxgpx this is actually very useful info.
We were wondering why we cannot reproduce it on Clippy CI, cc @phansch @matthiaskrgr

@dlrobertson
Copy link
Contributor

Is this still happening with debug-assertions enabled? I was unable to repro with debug-assertions = true.

Environment:
rust-clippy@5b8496603c4db231719b67c1f88b409e7b278e5e
rust@b92552d5578e4544006da0dd5e793a19c2149321

I also tried rust-clippy@8ac411dd42c6612b3184d305f9426e7e364cb211

@mati865
Copy link
Contributor

mati865 commented Jan 7, 2019

You should try with Clippy commit 194a91c45d5cbeadeb16afd75ce451753b230b81, if it passes tests then it should be fixed.

@ghost
Copy link
Author

ghost commented Jan 7, 2019

I'll test too, but only after the following PR is resolved: #57414 #57435

@Lokathor
Copy link
Contributor

Lokathor commented Jan 8, 2019

Very sorry I messed up that first PR @xftroxgpx XD

People should stop asking me for changes on git

@ghost
Copy link
Author

ghost commented Jan 8, 2019

@Lokathor no worries :) I couldn't have done it either - I've no idea what's happening there either way :D

@ghost
Copy link
Author

ghost commented Jan 8, 2019

I applied #57435 manually and then tested: I can confirm that the issue is fixed! (ie. latest rust-clippy passed: release compilation, some release tests(failed at run-pass/used_underscore_binding_macro.rs but irrelevant for this issue that I'm commenting on, so I created a new: rust-lang/rust-clippy#3643 ) and, most importantly, running ./target/release/cargo-clippy on itself just like in OP)

env
$ rustc -vV
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build//x86_64-unknown-linux-gnu/stage2/bin//rustc' in pwd='/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust' with args: '-vV'
rustc 1.33.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.33.0-dev
LLVM version: 8.0

/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust 
$ git describe  --all --long
heads/master-0-g9d54812829

/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy 
$ git describe --all --long
heads/master-0-g5b849660

$ cargo -vV
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo' in pwd='/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy' with args: '-vV'
cargo 1.33.0-dev (a62e36b4 2019-01-06)
release: 1.33.0
commit-hash: a62e36b4417cbf872960eda156130da932fb765d
commit-date: 2019-01-06

had compiled rustc with ignore-git = true, hence no git info in rustc -V. On second thought maybe this is why I keep having it git clean -dfx to avoid the 34mins later error that says something about a newer cc and that I have to use certain rustc to recompile it (i don't remember, I closed the terminal)

other try with rust-clippy commit 194a91c, suggested above

this failed to compile(see below), but I guess it doesn't matter since it's an earlier commit and it just works with the latest one instead.
   Compiling clippy_lints v0.0.212 (/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints)
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build//x86_64-unknown-linux-gnu/stage2/bin//rustc' in pwd='/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy' with args: '--edition=2018 --crate-name clippy_lints /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=bb00f581a588ec59 -C extra-filename=-bb00f581a588ec59 --out-dir /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps -L dependency=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps --extern cargo_metadata=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libcargo_metadata-507650c169410b97.rlib --extern if_chain=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libif_chain-70f92e7b45d67c40.rlib --extern itertools=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libitertools-e0e54779e0fe999d.rlib --extern lazy_static=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/liblazy_static-d8407dbd198e2382.rlib --extern matches=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libmatches-a26e32e0d355a8c6.rlib --extern pulldown_cmark=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libpulldown_cmark-8750f6e476612de3.rlib --extern quine_mc_cluskey=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libquine_mc_cluskey-f8d7f569c9699a06.rlib --extern regex_syntax=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libregex_syntax-0874f0ec2e4a1b15.rlib --extern semver=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libsemver-548d87d186ca3880.rlib --extern serde=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libserde-f7eea94ee0e33ecb.rlib --extern serde_derive=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libserde_derive-3c0db970ced9d85e.so --extern smallvec=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libsmallvec-9d8252e171534702.rlib --extern toml=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libtoml-311012f61c2d596c.rlib --extern unicode_normalization=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libunicode_normalization-44f9750f35c35a9e.rlib --extern url=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/liburl-390e734d0e3de798.rlib -L native=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/build/backtrace-sys-1a8a5e1d01182edf/out'
error[E0308]: mismatched types
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/consts.rs:307:51
    |
307 |                 let ret = miri_to_const(self.tcx, result);
    |                                                   ^^^^^^
    |                                                   |
    |                                                   expected reference, found struct `rustc::ty::Const`
    |                                                   help: consider borrowing here: `&result`
    |
    = note: expected type `&rustc::ty::Const<'_>`
               found type `rustc::ty::Const<'_>`

error[E0308]: mismatched types
  --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/enum_clike.rs:73:99
   |
73 |                     if let Some(Constant::Int(val)) = constant.and_then(|c| miri_to_const(cx.tcx, c)) {
   |                                                                -                                  ^ expected reference, found struct `rustc::ty::Const`
   |                                                                |
   |                                                                help: consider using `as_ref` instead: `as_ref().`
   |
   = note: expected type `&rustc::ty::Const<'_>`
              found type `rustc::ty::Const<'_>`

error[E0599]: no method named `def_id` found for type `std::option::Option<rustc::ty::Binder<rustc::ty::ExistentialTraitRef<'_>>>` in the current scope
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/len_zero.rs:307:46
    |
307 |             .associated_items(tt.principal().def_id())
    |                                              ^^^^^^

error: aborting due to 3 previous errors

Some errors occurred: E0308, E0599.
For more information about an error, try `rustc --explain E0308`.
error: Could not compile `clippy_lints`.

To learn more, run the command again with --verbose.

@ghost ghost closed this as completed Jan 8, 2019
@dlrobertson
Copy link
Contributor

FWIW I tested clippy @ 194a91c45d5cbeadeb16afd75ce451753b230b81 and I didn't hit a debug assert.

@ghost
Copy link
Author

ghost commented Jan 8, 2019

FWIW I tested clippy @ 194a91c45d5cbeadeb16afd75ce451753b230b81 and I didn't hit a debug assert.

@dlrobertson
Did you not hit any errors though? i did, but only with that commit, hit 3 errors on build so unable to do the tests(or anything relevant to this issue):

$ cargo clean
$ git checkout 194a91c45d5cbeadeb16afd75ce451753b230b81
$ time cargo build --release
...
   Compiling clippy_lints v0.0.212 (/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints)
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build//x86_64-unknown-linux-gnu/stage2/bin//rustc' in pwd='/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy' with args: '--edition=2018 --crate-name clippy_lints /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=c6858112a7aa0015 -C extra-filename=-c6858112a7aa0015 --out-dir /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps -L dependency=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps --extern cargo_metadata=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libcargo_metadata-d9f69ee9ecf3f2bc.rlib --extern if_chain=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libif_chain-034c1fe5e35ac2aa.rlib --extern itertools=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libitertools-465a56980f87d580.rlib --extern lazy_static=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/liblazy_static-bd61bca7ded02344.rlib --extern matches=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libmatches-ed88046a7241fda0.rlib --extern pulldown_cmark=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libpulldown_cmark-a2098d7fea542802.rlib --extern quine_mc_cluskey=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libquine_mc_cluskey-27879b8929c1d298.rlib --extern regex_syntax=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libregex_syntax-7939a1c60445dea8.rlib --extern semver=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libsemver-644f304805e46813.rlib --extern serde=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libserde-32cfc6411fa73157.rlib --extern serde_derive=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libserde_derive-94528bc15b1433de.so --extern smallvec=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libsmallvec-7611e02ec03f1d18.rlib --extern toml=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libtoml-5220d440fc5fe620.rlib --extern unicode_normalization=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libunicode_normalization-5354167e2fc18963.rlib --extern url=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/liburl-9a42211ad038b251.rlib -L native=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/build/backtrace-sys-49c9d8a23ceb873e/out'
error[E0308]: mismatched types
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/consts.rs:307:51
    |
307 |                 let ret = miri_to_const(self.tcx, result);
    |                                                   ^^^^^^
    |                                                   |
    |                                                   expected reference, found struct `rustc::ty::Const`
    |                                                   help: consider borrowing here: `&result`
    |
    = note: expected type `&rustc::ty::Const<'_>`
               found type `rustc::ty::Const<'_>`

error[E0308]: mismatched types
  --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/enum_clike.rs:73:99
   |
73 |                     if let Some(Constant::Int(val)) = constant.and_then(|c| miri_to_const(cx.tcx, c)) {
   |                                                                -                                  ^ expected reference, found struct `rustc::ty::Const`
   |                                                                |
   |                                                                help: consider using `as_ref` instead: `as_ref().`
   |
   = note: expected type `&rustc::ty::Const<'_>`
              found type `rustc::ty::Const<'_>`

error[E0599]: no method named `def_id` found for type `std::option::Option<rustc::ty::Binder<rustc::ty::ExistentialTraitRef<'_>>>` in the current scope
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/len_zero.rs:307:46
    |
307 |             .associated_items(tt.principal().def_id())
    |                                              ^^^^^^

error: aborting due to 3 previous errors

Some errors occurred: E0308, E0599.
For more information about an error, try `rustc --explain E0308`.
error: Could not compile `clippy_lints`.

To learn more, run the command again with --verbose.

real	5m8.794s
user	15m45.628s
sys	0m11.081s

$ rustc -vV
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build//x86_64-unknown-linux-gnu/stage2/bin//rustc' in pwd='/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust' with args: '-vV'
rustc 1.33.0-dev (9d5481282 2019-01-08)
binary: rustc
commit-hash: 9d54812829e9d92dac35a4a0f358cdc5a2475371
commit-date: 2019-01-08
host: x86_64-unknown-linux-gnu
release: 1.33.0-dev
LLVM version: 8.0

$ cargo -vV
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo' in pwd='/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust' with args: '-vV'
cargo 1.33.0-dev (a62e36b4 2019-01-06)
release: 1.33.0
commit-hash: a62e36b4417cbf872960eda156130da932fb765d
commit-date: 2019-01-06


$ time cargo test --release
   Compiling clippy_lints v0.0.212 (/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints)
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build//x86_64-unknown-linux-gnu/stage2/bin//rustc' in pwd='/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy' with args: '--edition=2018 --crate-name clippy_lints /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=c6858112a7aa0015 -C extra-filename=-c6858112a7aa0015 --out-dir /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps -L dependency=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps --extern cargo_metadata=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libcargo_metadata-d9f69ee9ecf3f2bc.rlib --extern if_chain=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libif_chain-034c1fe5e35ac2aa.rlib --extern itertools=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libitertools-465a56980f87d580.rlib --extern lazy_static=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/liblazy_static-bd61bca7ded02344.rlib --extern matches=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libmatches-ed88046a7241fda0.rlib --extern pulldown_cmark=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libpulldown_cmark-a2098d7fea542802.rlib --extern quine_mc_cluskey=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libquine_mc_cluskey-27879b8929c1d298.rlib --extern regex_syntax=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libregex_syntax-7939a1c60445dea8.rlib --extern semver=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libsemver-644f304805e46813.rlib --extern serde=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libserde-32cfc6411fa73157.rlib --extern serde_derive=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libserde_derive-94528bc15b1433de.so --extern smallvec=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libsmallvec-7611e02ec03f1d18.rlib --extern toml=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libtoml-5220d440fc5fe620.rlib --extern unicode_normalization=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/libunicode_normalization-5354167e2fc18963.rlib --extern url=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/deps/liburl-9a42211ad038b251.rlib -L native=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/release/build/backtrace-sys-49c9d8a23ceb873e/out'
error[E0308]: mismatched types
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/consts.rs:307:51
    |
307 |                 let ret = miri_to_const(self.tcx, result);
    |                                                   ^^^^^^
    |                                                   |
    |                                                   expected reference, found struct `rustc::ty::Const`
    |                                                   help: consider borrowing here: `&result`
    |
    = note: expected type `&rustc::ty::Const<'_>`
               found type `rustc::ty::Const<'_>`

error[E0308]: mismatched types
  --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/enum_clike.rs:73:99
   |
73 |                     if let Some(Constant::Int(val)) = constant.and_then(|c| miri_to_const(cx.tcx, c)) {
   |                                                                -                                  ^ expected reference, found struct `rustc::ty::Const`
   |                                                                |
   |                                                                help: consider using `as_ref` instead: `as_ref().`
   |
   = note: expected type `&rustc::ty::Const<'_>`
              found type `rustc::ty::Const<'_>`

error[E0599]: no method named `def_id` found for type `std::option::Option<rustc::ty::Binder<rustc::ty::ExistentialTraitRef<'_>>>` in the current scope
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/len_zero.rs:307:46
    |
307 |             .associated_items(tt.principal().def_id())
    |                                              ^^^^^^

error: aborting due to 3 previous errors

Some errors occurred: E0308, E0599.
For more information about an error, try `rustc --explain E0308`.
error: Could not compile `clippy_lints`.
warning: build failed, waiting for other jobs to finish...
error: build failed

real	1m7.818s
user	3m56.892s
sys	0m2.909s

But this doesn't matter since it worked with the newer/later commit ;-)

@mati865
Copy link
Contributor

mati865 commented Jan 9, 2019

It matters because there is only workaround for the bug, fixing it would be better.

@ghost
Copy link
Author

ghost commented Jan 9, 2019

@mati865 I meant: it doesn't matter that it error-ed with clippy commit 194a91c45d5cbeadeb16afd75ce451753b230b81 because it didn't err with latest clippy commit.

@ghost
Copy link
Author

ghost commented Jan 9, 2019

It matters because there is only workaround for the bug, fixing it would be better.

Wait, so you're actually saying that the ICE doesn't happen anymore because clippy did a workaround for it? (instead of something in rustc having been fixed since then?)

So that means that with the same clippy commit from OP, I should be able to reproduce the ICE, trying:

I'm getting unrelated errors:
$ time cargo build
...
   Compiling clippy_lints v0.0.212 (/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints)
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build//x86_64-unknown-linux-gnu/stage2/bin//rustc' in pwd='/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy' with args: '--edition=2018 --crate-name clippy_lints /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=3d6e9f7e0458b600 -C extra-filename=-3d6e9f7e0458b600 --out-dir /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps -C incremental=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/incremental -L dependency=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps --extern cargo_metadata=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/libcargo_metadata-8df71ebc3ec8c7b1.rlib --extern if_chain=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/libif_chain-18472c918195eb10.rlib --extern itertools=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/libitertools-63f847f4b07a7a94.rlib --extern lazy_static=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/liblazy_static-e134885038065a59.rlib --extern matches=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/libmatches-ff9c7cc1d9e9c702.rlib --extern pulldown_cmark=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/libpulldown_cmark-b5927e461cff9f13.rlib --extern quine_mc_cluskey=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/libquine_mc_cluskey-c716d5d0c4b4bb66.rlib --extern regex_syntax=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/libregex_syntax-af255f912840c0b8.rlib --extern semver=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/libsemver-d2211cb1aad9a77c.rlib --extern serde=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/libserde-31302d9e7cf738a8.rlib --extern serde_derive=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/libserde_derive-46f8713235b67e51.so --extern smallvec=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/libsmallvec-b10874f5e464b3e5.rlib --extern toml=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/libtoml-619b7a67cda19680.rlib --extern unicode_normalization=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/libunicode_normalization-ae27b76e45d9c760.rlib --extern url=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/liburl-899a520053e9b032.rlib -L native=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/build/backtrace-sys-4034742239ad3cea/out'
error[E0277]: `syntax_pos::symbol::LocalInternedString` cannot be shared between threads safely
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/lib.rs:352:34
    |
352 |     reg.register_early_lint_pass(box enum_variants::EnumVariantNames::new(conf.enum_variant_name_threshold));
    |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `syntax_pos::symbol::LocalInternedString` cannot be shared between threads safely
    |
    = help: within `(syntax_pos::symbol::LocalInternedString, std::string::String)`, the trait `std::marker::Sync` is not implemented for `syntax_pos::symbol::LocalInternedString`
    = note: required because it appears within the type `(syntax_pos::symbol::LocalInternedString, std::string::String)`
    = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<(syntax_pos::symbol::LocalInternedString, std::string::String)>`
    = note: required because it appears within the type `alloc::raw_vec::RawVec<(syntax_pos::symbol::LocalInternedString, std::string::String)>`
    = note: required because it appears within the type `std::vec::Vec<(syntax_pos::symbol::LocalInternedString, std::string::String)>`
    = note: required because it appears within the type `enum_variants::EnumVariantNames`
    = note: required for the cast to the object type `dyn rustc::lint::EarlyLintPass + std::marker::Send + std::marker::Sync`

error[E0277]: `syntax_pos::symbol::LocalInternedString` cannot be sent between threads safely
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/lib.rs:352:34
    |
352 |     reg.register_early_lint_pass(box enum_variants::EnumVariantNames::new(conf.enum_variant_name_threshold));
    |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `syntax_pos::symbol::LocalInternedString` cannot be sent between threads safely
    |
    = help: within `(syntax_pos::symbol::LocalInternedString, std::string::String)`, the trait `std::marker::Send` is not implemented for `syntax_pos::symbol::LocalInternedString`
    = note: required because it appears within the type `(syntax_pos::symbol::LocalInternedString, std::string::String)`
    = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<(syntax_pos::symbol::LocalInternedString, std::string::String)>`
    = note: required because it appears within the type `alloc::raw_vec::RawVec<(syntax_pos::symbol::LocalInternedString, std::string::String)>`
    = note: required because it appears within the type `std::vec::Vec<(syntax_pos::symbol::LocalInternedString, std::string::String)>`
    = note: required because it appears within the type `enum_variants::EnumVariantNames`
    = note: required for the cast to the object type `dyn rustc::lint::EarlyLintPass + std::marker::Send + std::marker::Sync`

error[E0308]: mismatched types
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/consts.rs:159:63
    |
159 |         LitKind::ByteStr(ref s) => Constant::Binary(Rc::clone(s)),
    |                                                               ^ expected struct `std::rc::Rc`, found struct `std::sync::Arc`
    |
    = note: expected type `&std::rc::Rc<std::vec::Vec<u8>>`
               found type `&std::sync::Arc<std::vec::Vec<u8>>`

error[E0308]: mismatched types
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/consts.rs:307:51
    |
307 |                 let ret = miri_to_const(self.tcx, result);
    |                                                   ^^^^^^
    |                                                   |
    |                                                   expected reference, found struct `rustc::ty::Const`
    |                                                   help: consider borrowing here: `&result`
    |
    = note: expected type `&rustc::ty::Const<'_>`
               found type `rustc::ty::Const<'_>`

error[E0308]: mismatched types
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/utils/mod.rs:226:50
    |
226 |             for item in mem::replace(&mut items, Rc::new(vec![])).iter() {
    |                                                  ^^^^^^^^^^^^^^^ expected struct `std::sync::Arc`, found struct `std::rc::Rc`
    |
    = note: expected type `std::sync::Arc<std::vec::Vec<rustc::hir::def::Export>>`
               found type `std::rc::Rc<std::vec::Vec<_>>`

error[E0599]: no method named `predicate_must_hold` found for type `rustc::infer::InferCtxt<'_, '_, '_>` in the current scope
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/utils/mod.rs:274:30
    |
274 |         .enter(|infcx| infcx.predicate_must_hold(&obligation))
    |                              ^^^^^^^^^^^^^^^^^^^
    |
    = help: did you mean `predicate_may_hold`?

error[E0599]: no method named `moves_by_default` found for type `&'tcx rustc::ty::TyS<'tcx>` in the current scope
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/utils/mod.rs:887:9
    |
887 |     !ty.moves_by_default(cx.tcx.global_tcx(), cx.param_env, DUMMY_SP)
    |         ^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/enum_clike.rs:73:99
   |
73 |                     if let Some(Constant::Int(val)) = constant.and_then(|c| miri_to_const(cx.tcx, c)) {
   |                                                                -                                  ^ expected reference, found struct `rustc::ty::Const`
   |                                                                |
   |                                                                help: consider using `as_ref` instead: `as_ref().`
   |
   = note: expected type `&rustc::ty::Const<'_>`
              found type `rustc::ty::Const<'_>`

error[E0599]: no method named `def_id` found for type `std::option::Option<rustc::ty::Binder<rustc::ty::ExistentialTraitRef<'_>>>` in the current scope
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/len_zero.rs:307:46
    |
307 |             .associated_items(tt.principal().def_id())
    |                                              ^^^^^^

error[E0599]: no method named `moves_by_default` found for type `&rustc::ty::TyS<'_>` in the current scope
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/question_mark.rs:116:17
    |
116 |         expr_ty.moves_by_default(cx.tcx, cx.param_env, expression.span)
    |                 ^^^^^^^^^^^^^^^^

error: aborting due to 10 previous errors

Some errors occurred: E0277, E0308, E0599.
For more information about an error, try `rustc --explain E0277`.
error: Could not compile `clippy_lints`.

To learn more, run the command again with --verbose.

real	2m55.131s
user	8m24.497s
sys	0m7.911s

All that got fixed by clippy commit: rust-lang/rust-clippy@756b32e

which I've tried too:

$ time cargo build
...
   Compiling clippy v0.0.212 (/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy)
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build//x86_64-unknown-linux-gnu/stage2/bin//rustc' in pwd='/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy' with args: '--edition=2018 --crate-name build_script_build /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/build.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=01aa6e327713cacf -C extra-filename=-01aa6e327713cacf --out-dir /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/build/clippy-01aa6e327713cacf -C incremental=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/incremental -L dependency=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps --extern rustc_tools_util=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/target/debug/deps/librustc_tools_util-356afa5dd41fee1a.rlib'
error[E0308]: mismatched types
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/consts.rs:307:51
    |
307 |                 let ret = miri_to_const(self.tcx, result);
    |                                                   ^^^^^^
    |                                                   |
    |                                                   expected reference, found struct `rustc::ty::Const`
    |                                                   help: consider borrowing here: `&result`
    |
    = note: expected type `&rustc::ty::Const<'_>`
               found type `rustc::ty::Const<'_>`

error[E0308]: mismatched types
  --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/enum_clike.rs:73:99
   |
73 |                     if let Some(Constant::Int(val)) = constant.and_then(|c| miri_to_const(cx.tcx, c)) {
   |                                                                -                                  ^ expected reference, found struct `rustc::ty::Const`
   |                                                                |
   |                                                                help: consider using `as_ref` instead: `as_ref().`
   |
   = note: expected type `&rustc::ty::Const<'_>`
              found type `rustc::ty::Const<'_>`

error[E0599]: no method named `def_id` found for type `std::option::Option<rustc::ty::Binder<rustc::ty::ExistentialTraitRef<'_>>>` in the current scope
   --> /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/len_zero.rs:307:46
    |
307 |             .associated_items(tt.principal().def_id())
    |                                              ^^^^^^

error: aborting due to 3 previous errors

Some errors occurred: E0308, E0599.
For more information about an error, try `rustc --explain E0308`.
error: Could not compile `clippy_lints`.

To learn more, run the command again with --verbose.

real	0m26.782s
user	0m29.112s
sys	0m0.460s

Ok, unless someone can suggest a clippy commit that still reproduces this ICE (instead of giving unrelated errors) I'm going to just not care if this ICE got fixed or not in rust, since it's basically not possible to reproduce anymore due to potentially clippy having worked around it. :D Translation: I was lazy! but thanks to mati865, I am no more.

@mati865
Copy link
Contributor

mati865 commented Jan 9, 2019

Wait, so you're actually saying that the ICE doesn't happen anymore because clippy did a workaround for it? (instead of something in rustc having been fixed since then?)

Clippy removed lint that was causing ICE. It's still unknown if it was bug in the lint or in Rust. It'd be great to readd it when it works.

So that means that with the same clippy commit from OP, I should be able to reproduce the ICE, trying:
[...]
Ok, unless someone can suggest a clippy commit that still reproduces this ICE

194a91c45d5cbeadeb16afd75ce451753b230b81 is the latest commit before applying workaround and eventually removing the lint.
Clippy uses API that changes very often hence the errors. dlrobertson probably fixed them or is using Rust build old enough the API didn't change yet.

@ghost
Copy link
Author

ghost commented Jan 9, 2019

Confirmed the ICE still happens:

$ time RUST_BACKTRACE=1 ./target/debug/cargo-clippy 
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo' in pwd='/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy' with args: 'check'
    Checking unicode-normalization v0.1.7
    Checking regex-syntax v0.6.4
    Checking thread_local v0.3.6
    Checking itertools v0.7.11
error: internal compiler error: src/librustc/ty/context.rs:246: node type $crate::lazy::Lazy<Mutex<ThreadIdManager>> (id=2800) with HirId::owner DefId(0/0:134 ~ thread_local[6342]::thread_id[0]::{{impl}}[3]::deref[0]::__stability[0]::LAZY[0]) cannot be placed in TypeckTables with local_id_root DefId(0/0:131 ~ thread_local[6342]::thread_id[0]::{{impl}}[3]::deref[0]::__stability[0])

thread '<unnamed>' panicked at 'Box<Any>', src/librustc_errors/lib.rs:590:9
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
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::bug_fmt
  14: rustc::ty::context::validate_hir_id_for_typeck_tables::{{closure}}
  15: rustc::ty::context::tls::with::{{closure}}
  16: rustc::ty::context::tls::with_context::{{closure}}
  17: rustc::ty::context::tls::with_context_opt
  18: rustc::ty::context::tls::with_context
  19: rustc::ty::context::tls::with
  20: rustc::ty::context::TypeckTables::node_id_to_type_opt
  21: <clippy_lints::random_state::Pass as rustc::lint::LateLintPass<'a, 'tcx>>::check_ty
             at /home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy/clippy_lints/src/random_state.rs:38
  22: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_ty
  23: rustc::hir::intravisit::walk_item
  24: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  25: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  26: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_decl
  27: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_stmt
  28: rustc::hir::intravisit::walk_block
  29: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_block
  30: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  31: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
  32: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_body
  33: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_nested_body
  34: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_fn
  35: rustc::hir::intravisit::walk_item
  36: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  37: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  38: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_decl
  39: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_stmt
  40: rustc::hir::intravisit::walk_block
  41: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_block
  42: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  43: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
  44: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_body
  45: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_nested_body
  46: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_fn
  47: rustc::hir::intravisit::walk_impl_item
  48: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  49: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_impl_item
  50: rustc::hir::intravisit::walk_impl_item_ref
  51: rustc::hir::intravisit::walk_item
  52: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  53: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  54: rustc::hir::intravisit::walk_mod
  55: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  56: rustc::hir::intravisit::walk_item
  57: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  58: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  59: rustc::hir::intravisit::walk_mod
  60: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  61: rustc::hir::intravisit::walk_crate
  62: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  63: rustc::lint::context::check_crate
  64: rustc::util::common::time
  65: rustc_rayon_core::tlv::with
  66: <std::thread::local::LocalKey<T>>::with
  67: rustc::ty::context::tls::enter_global
  68: rustc::ty::context::TyCtxt::create_and_enter
  69: rustc_driver::driver::phase_3_run_analysis_passes
  70: rustc_driver::driver::compile_input
  71: rustc_driver::run_compiler_with_pool
  72: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  73: std::panicking::try::do_call
  74: __rust_maybe_catch_panic
  75: std::panicking::try
  76: std::panic::catch_unwind
  77: rustc_rayon_core::unwind::halt_unwinding
  78: <rustc_rayon_core::job::StackJob<L, F, R> as rustc_rayon_core::job::Job>::execute
  79: rustc_rayon_core::registry::WorkerThread::wait_until_cold
  80: rustc_rayon_core::registry::main_loop::{{closure}}
  81: <scoped_tls::ScopedKey<T>>::set
  82: <std::thread::local::LocalKey<T>>::with
  83: <scoped_tls::ScopedKey<T>>::set
  84: rustc_rayon_core::thread_pool::ThreadPool::scoped_pool::{{closure}}
  85: __rust_maybe_catch_panic
query stack during panic:
end of query stack
error: aborting due to previous error


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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.33.0-dev (9d5481282 2019-01-08) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `thread_local`.
warning: build failed, waiting for other jobs to finish...
^C  Building [=============================>                          ] 62/114

real	0m5.080s
user	0m0.003s
sys	0m0.001s

it happens because I undid the workaround that clippy applied to avoid this ICE(ie. brought back random_state lint), like so:

diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs
index 35c00fb6..4a5972f8 100644
--- a/clippy_lints/src/lib.rs
+++ b/clippy_lints/src/lib.rs
@@ -180,6 +180,7 @@ pub mod precedence;
 pub mod ptr;
 pub mod ptr_offset_with_cast;
 pub mod question_mark;
+pub mod random_state;
 pub mod ranges;
 pub mod redundant_clone;
 pub mod redundant_field_names;
@@ -486,6 +487,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
     reg.register_late_lint_pass(box ptr_offset_with_cast::Pass);
     reg.register_late_lint_pass(box redundant_clone::RedundantClone);
     reg.register_late_lint_pass(box slow_vector_initialization::Pass);
+    reg.register_late_lint_pass(box random_state::Pass);
     reg.register_late_lint_pass(box types::RefToMut);
 
     reg.register_lint_group("clippy::restriction", Some("clippy_restriction"), vec![
@@ -1028,6 +1030,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
         fallible_impl_from::FALLIBLE_IMPL_FROM,
         mutex_atomic::MUTEX_INTEGER,
         needless_borrow::NEEDLESS_BORROW,
+        random_state::RANDOM_STATE,
         redundant_clone::REDUNDANT_CLONE,
         unwrap::PANICKING_UNWRAP,
         unwrap::UNNECESSARY_UNWRAP,
diff --git a/clippy_lints/src/random_state.rs b/clippy_lints/src/random_state.rs
new file mode 100644
index 00000000..930733d7
--- /dev/null
+++ b/clippy_lints/src/random_state.rs
@@ -0,0 +1,51 @@
+use crate::utils::{match_type, paths, span_lint};
+use rustc::hir::Ty;
+use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
+use rustc::ty::subst::UnpackedKind;
+use rustc::ty::TyKind;
+use rustc::{declare_tool_lint, lint_array};
+
+/// **What it does:** Checks for usage of `RandomState`
+///
+/// **Why is this bad?** Some applications don't need collision prevention
+/// which lowers the performance.
+///
+/// **Known problems:** None.
+///
+/// **Example:**
+/// ```rust
+/// fn x() {
+///     let mut map = std::collections::HashMap::new();
+///     map.insert(3, 4);
+/// }
+/// ```
+declare_clippy_lint! {
+    pub RANDOM_STATE,
+    nursery,
+    "use of RandomState"
+}
+
+pub struct Pass;
+
+impl LintPass for Pass {
+    fn get_lints(&self) -> LintArray {
+        lint_array!(RANDOM_STATE)
+    }
+}
+
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_ty(&mut self, cx: &LateContext<'a, 'tcx>, ty: &Ty) {
+        if let Some(tys) = cx.tables.node_id_to_type_opt(ty.hir_id) {
+            if let TyKind::Adt(_, substs) = tys.sty {
+                for subst in substs {
+                    if let UnpackedKind::Type(build_hasher) = subst.unpack() {
+                        if match_type(cx, build_hasher, &paths::RANDOM_STATE) {
+                            span_lint(cx, RANDOM_STATE, ty.span, "usage of RandomState");
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
diff --git a/clippy_lints/src/utils/paths.rs b/clippy_lints/src/utils/paths.rs
index 0779d779..0ec684e3 100644
--- a/clippy_lints/src/utils/paths.rs
+++ b/clippy_lints/src/utils/paths.rs
@@ -73,6 +73,7 @@ pub const PATH_BUF: [&str; 3] = ["std", "path", "PathBuf"];
 pub const PATH_TO_PATH_BUF: [&str; 4] = ["std", "path", "Path", "to_path_buf"];
 pub const PTR_NULL: [&str; 2] = ["ptr", "null"];
 pub const PTR_NULL_MUT: [&str; 2] = ["ptr", "null_mut"];
+pub const RANDOM_STATE: [&str; 5] = ["std", "collections", "hash", "map", "RandomState"];
 pub const RANGE: [&str; 3] = ["core", "ops", "Range"];
 pub const RANGE_ARGUMENT_TRAIT: [&str; 3] = ["core", "ops", "RangeBounds"];
 pub const RANGE_FROM: [&str; 3] = ["core", "ops", "RangeFrom"];
diff --git a/tests/run-pass/used_underscore_binding_macro.rs b/tests/run-pass/used_underscore_binding_macro.rs
index 8b6c6557..dc590cbc 100644
--- a/tests/run-pass/used_underscore_binding_macro.rs
+++ b/tests/run-pass/used_underscore_binding_macro.rs
@@ -8,6 +8,7 @@
 // except according to those terms.
 
 #![allow(clippy::useless_attribute)] //issue #2910
+#![allow(clippy::random_state)]
 
 #[macro_use]
 extern crate serde_derive;
diff --git a/tests/ui/random_state.rs b/tests/ui/random_state.rs
new file mode 100644
index 00000000..9f278ecc
--- /dev/null
+++ b/tests/ui/random_state.rs
@@ -0,0 +1,20 @@
+#![warn(clippy::random_state)]
+
+use std::collections::hash_map::RandomState;
+use std::collections::hash_map::{DefaultHasher, HashMap};
+use std::hash::BuildHasherDefault;
+
+fn main() {
+    // Should warn
+    let mut map = HashMap::new();
+    map.insert(3, 4);
+    let mut map = HashMap::with_hasher(RandomState::new());
+    map.insert(true, false);
+    let _map: HashMap<_, _> = vec![(2, 3)].into_iter().collect();
+    let _vec: Vec<HashMap<i32, i32>>;
+    // Shouldn't warn
+    let _map: HashMap<i32, i32, BuildHasherDefault<DefaultHasher>> = HashMap::default();
+    let mut map = HashMap::with_hasher(BuildHasherDefault::<DefaultHasher>::default());
+    map.insert("a", "b");
+}
+
diff --git a/tests/ui/random_state.stderr b/tests/ui/random_state.stderr
new file mode 100644
index 00000000..df224bf0
--- /dev/null
+++ b/tests/ui/random_state.stderr
@@ -0,0 +1,28 @@
+error: usage of RandomState
+  --> $DIR/random_state.rs:9:19
+   |
+LL |     let mut map = HashMap::new();
+   |                   ^^^^^^^^^^^^
+   |
+   = note: `-D clippy::random-state` implied by `-D warnings`
+
+error: usage of RandomState
+  --> $DIR/random_state.rs:11:19
+   |
+LL |     let mut map = HashMap::with_hasher(RandomState::new());
+   |                   ^^^^^^^^^^^^^^^^^^^^
+
+error: usage of RandomState
+  --> $DIR/random_state.rs:13:15
+   |
+LL |     let _map: HashMap<_, _> = vec![(2, 3)].into_iter().collect();
+   |               ^^^^^^^^^^^^^
+
+error: usage of RandomState
+  --> $DIR/random_state.rs:14:19
+   |
+LL |     let _vec: Vec<HashMap<i32, i32>>;
+   |                   ^^^^^^^^^^^^^^^^^
+
+error: aborting due to 4 previous errors
+

(the above is to be applied on current rust-clippy HEAD which is 5b8496603c4db231719b67c1f88b409e7b278e5e)

rustc/cargo used
$ rustc -vV
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build//x86_64-unknown-linux-gnu/stage2/bin//rustc' in pwd='/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy' with args: '-vV'
rustc 1.33.0-dev (9d5481282 2019-01-08)
binary: rustc
commit-hash: 9d54812829e9d92dac35a4a0f358cdc5a2475371
commit-date: 2019-01-08
host: x86_64-unknown-linux-gnu
release: 1.33.0-dev
LLVM version: 8.0

$ cargo -Vv
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo' in pwd='/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust-clippy' with args: '-Vv'
cargo 1.33.0-dev (a62e36b4 2019-01-06)
release: 1.33.0
commit-hash: a62e36b4417cbf872960eda156130da932fb765d
commit-date: 2019-01-06

rustc's compile-time config.toml can be seen on this gist here

also tested with even newer rustc:

$ rustc -vV
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build//x86_64-unknown-linux-gnu/stage2/bin//rustc' in pwd='/home/xftroxgpx' with args: '-vV'
rustc 1.33.0-dev (664c7797f 2019-01-09)
binary: rustc
commit-hash: 664c7797f6bfddf9f5e67474c2fd8017f91d7110
commit-date: 2019-01-09
host: x86_64-unknown-linux-gnu
release: 1.33.0-dev
LLVM version: 8.0

@ghost ghost reopened this Jan 9, 2019
@ghost
Copy link
Author

ghost commented Jan 9, 2019

ICE has the same message as the following:
#55172
#54158
#50328
#43982
#48141
#47953
#46781

That is, this message:

/// Validate that the given HirId (respectively its `local_id` part) can be
/// safely used as a key in the tables of a TypeckTable. For that to be
/// the case, the HirId must have the same `owner` as all the other IDs in
/// this table (signified by `local_id_root`). Otherwise the HirId
/// would be in a different frame of reference and using its `local_id`
/// would result in lookup errors, or worse, in silently wrong data being
/// stored/returned.
fn validate_hir_id_for_typeck_tables(local_id_root: Option<DefId>,
                                     hir_id: hir::HirId,
                                     mut_access: bool) {
    if cfg!(debug_assertions) {
        if let Some(local_id_root) = local_id_root {
            if hir_id.owner != local_id_root.index {
                ty::tls::with(|tcx| {
                    let node_id = tcx.hir().hir_to_node_id(hir_id);

                    bug!("node {} with HirId::owner {:?} cannot be placed in \
                          TypeckTables with local_id_root {:?}",
                         tcx.hir().node_to_string(node_id),
                         DefId::local(hir_id.owner),
                         local_id_root)
                });
            }
        } else {
            // We use "Null Object" TypeckTables in some of the analysis passes.
            // These are just expected to be empty and their `local_id_root` is
            // `None`. Therefore we cannot verify whether a given `HirId` would
            // be a valid key for the given table. Instead we make sure that
            // nobody tries to write to such a Null Object table.
            if mut_access {
                bug!("access to invalid TypeckTables")
            }
        }
    }
}

Since some issues mention it happens with extended=true, for me it's already false, so that's not a factor. But obviously debug-assertions = true is required!

@ghost ghost changed the title error: internal compiler error: src/librustc/ty/context.rs:248 error: internal compiler error: src/librustc/ty/context.rs:248 "node {} with HirId::owner {:?} cannot be placed in TypeckTables with local_id_root {:?}" Jan 9, 2019
@ghost
Copy link
Author

ghost commented Jan 9, 2019

Minimal(to my ability) steps to reproduce this ICE:

  1. get a rust compiler that was compiled with this config.toml (click me to expand)

It's possible that only debug-assertions = true is required and nothing else(compared to normal nightly compiler, let's say), but here are all the settings in config.toml:

[llvm]
optimize = true
release-debuginfo = false
assertions = false
ccache = "/usr/bin/ccache"
static-libstdcpp = false
ninja = true
targets = "X86"
experimental-targets = ""
link-jobs = 4
[build]
build = "x86_64-unknown-linux-gnu"
host = ["x86_64-unknown-linux-gnu"]
target = ["x86_64-unknown-linux-gnu"]
docs = true
compiler-docs = false
submodules = true
fast-submodules = true
locked-deps = false
full-bootstrap = false
extended = false
tools = [ "src" ]
verbose = 0
sanitizers = false
profiler = false
low-priority = true
local-rebuild = false
print-step-timings = false
[install]
[rust]
optimize = true
debug = false
codegen-units = 1
codegen-units-std = 1
debug-assertions = true #required!
debuginfo = false
debuginfo-lines = false
debuginfo-only-std = false
debuginfo-tools = false
backtrace = true
incremental = true
experimental-parallel-queries = true
channel = "dev"
rpath = true
verbose-tests = false
optimize-tests = false
debuginfo-tests = false
codegen-tests = false
ignore-git = false
lld = false
deny-warnings = true
backtrace-on-ice = true
[target.x86_64-unknown-linux-gnu]
[dist]
src-tarball = false
missing-tools = false
  1. cd /tmp && git clone https://github.com/rust-lang-nursery/rust-clippy.git
  2. cd rust-clippy && git checkout 5b8496603c4db231719b67c1f88b409e7b278e5e
    (that's current latest clippy HEAD)
4. apply this minimal clippy patch (click me to expand)

ie. cd rust-clippy && patch -Np1 -i ./this.patch

diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs
index 35c00fb6..4a5972f8 100644
--- a/clippy_lints/src/lib.rs
+++ b/clippy_lints/src/lib.rs
@@ -180,6 +180,7 @@ pub mod precedence;
 pub mod ptr;
 pub mod ptr_offset_with_cast;
 pub mod question_mark;
+pub mod random_state;
 pub mod ranges;
 pub mod redundant_clone;
 pub mod redundant_field_names;
@@ -486,6 +487,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
     reg.register_late_lint_pass(box ptr_offset_with_cast::Pass);
     reg.register_late_lint_pass(box redundant_clone::RedundantClone);
     reg.register_late_lint_pass(box slow_vector_initialization::Pass);
+    reg.register_late_lint_pass(box random_state::Pass);
     reg.register_late_lint_pass(box types::RefToMut);
 
     reg.register_lint_group("clippy::restriction", Some("clippy_restriction"), vec![
@@ -1028,6 +1030,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
         fallible_impl_from::FALLIBLE_IMPL_FROM,
         mutex_atomic::MUTEX_INTEGER,
         needless_borrow::NEEDLESS_BORROW,
+        random_state::RANDOM_STATE,
         redundant_clone::REDUNDANT_CLONE,
         unwrap::PANICKING_UNWRAP,
         unwrap::UNNECESSARY_UNWRAP,
diff --git a/clippy_lints/src/random_state.rs b/clippy_lints/src/random_state.rs
new file mode 100644
index 00000000..d75ffd47
--- /dev/null
+++ b/clippy_lints/src/random_state.rs
@@ -0,0 +1,25 @@
+use rustc::hir::Ty;
+use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
+use rustc::{declare_tool_lint, lint_array};
+
+declare_clippy_lint! {
+    pub RANDOM_STATE,
+    nursery,
+    "use of RandomState"
+}
+
+pub struct Pass;
+
+impl LintPass for Pass {
+    fn get_lints(&self) -> LintArray {
+        lint_array!(RANDOM_STATE)
+    }
+}
+
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_ty(&mut self, cx: &LateContext<'a, 'tcx>, ty: &Ty) {
+        if let Some(_tys) = cx.tables.node_id_to_type_opt(ty.hir_id) { // ICE will be here
+        }
+    }
+}
+
  1. build clippy via cargo build (ie. debug mode because it's faster)
  2. cd /tmp && cargo new dummy1 && cd dummy1
  3. edit Cargo.toml to add dependency line thread_local = "= 0.3.6"
looks like this(click me to expand)
[package]
name = "dummy3"
version = "0.1.0"
authors = ["blah <[email protected]>"]                              
edition = "2018"

[dependencies]
thread_local = "= 0.3.6"
  1. Run that clippy on dummy1 like this: RUST_BACKTRACE=1 /tmp/rust-clippy/target/debug/cargo-clippy
    (assuming you're already in /tmp/dummy1/ directory)
What you'll see is approximately this (click me to expand):
/tmp/dummy4 
$ RUST_BACKTRACE=1 /tmp/rust-clippy/target/debug/cargo-clippy 
!! LD_LIBRARY_PATH=/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:/home/xftroxgpx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:
!! Executing '/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo' in pwd='/tmp/dummy4' with args: 'check'
    Updating crates.io index
glibc64:../sysdeps/posix/getaddrinfo.c:2212/getaddrinfo: cargo[22956](full:'/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo') for user xftroxgpx(1000(eff:xftroxgpx(1000))) 1of2 attempting to resolve (requested)hostname:
api.github.com
glibc64:../sysdeps/posix/getaddrinfo.c:2212/getaddrinfo: !! REENTRANT_NAME == 'gethostbyname2_r' hostname='api.github.com'
cargo: cargo[22956](full:'/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo') for user xftroxgpx(1000(eff:xftroxgpx(1000))) 2of2 successfully resolved requested hostname('api.github.com') which was not transformed('api.github.com') as follows:
192.30.253.117 api.github.com
glibc64:../sysdeps/posix/getaddrinfo.c:2212/getaddrinfo: cargo[22956](full:'/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo') for user xftroxgpx(1000(eff:xftroxgpx(1000))) 1of2 attempting to resolve (requested)hostname:
github.com
glibc64:../sysdeps/posix/getaddrinfo.c:2212/getaddrinfo: !! REENTRANT_NAME == 'gethostbyname2_r' hostname='github.com'
cargo: cargo[22956](full:'/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo') for user xftroxgpx(1000(eff:xftroxgpx(1000))) 2of2 successfully resolved requested hostname('github.com') which was not transformed('github.com') as follows:
140.82.118.3 github.com
glibc64:../sysdeps/posix/getaddrinfo.c:2212/getaddrinfo: cargo[22956](full:'/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo') for user xftroxgpx(1000(eff:xftroxgpx(1000))) 1of2 attempting to resolve (requested)hostname:
github.com
glibc64:../sysdeps/posix/getaddrinfo.c:2212/getaddrinfo: !! REENTRANT_NAME == 'gethostbyname2_r' hostname='github.com'
cargo: cargo[22956](full:'/home/xftroxgpx/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo') for user xftroxgpx(1000(eff:xftroxgpx(1000))) 2of2 successfully resolved requested hostname('github.com') which was not transformed('github.com') as follows:
140.82.118.3 github.com
    Checking lazy_static v1.2.0
    Checking thread_local v0.3.6
error: internal compiler error: src/librustc/ty/context.rs:246: node type $crate::lazy::Lazy<Mutex<ThreadIdManager>> (id=2800) with HirId::owner DefId(0/0:134 ~ thread_local[ca19]::thread_id[0]::{{impl}}[3]::deref[0]::__stability[0]::LAZY[0]) cannot be placed in TypeckTables with local_id_root DefId(0/0:131 ~ thread_local[ca19]::thread_id[0]::{{impl}}[3]::deref[0]::__stability[0])

thread '<unnamed>' panicked at 'Box<Any>', src/librustc_errors/lib.rs:588:9
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
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::bug_fmt
  14: rustc::ty::context::validate_hir_id_for_typeck_tables::{{closure}}
  15: rustc::ty::context::tls::with::{{closure}}
  16: rustc::ty::context::tls::with_context::{{closure}}
  17: rustc::ty::context::tls::with_context_opt
  18: rustc::ty::context::tls::with_context
  19: rustc::ty::context::tls::with
  20: rustc::ty::context::TypeckTables::node_id_to_type_opt
  21: <clippy_lints::random_state::Pass as rustc::lint::LateLintPass<'a, 'tcx>>::check_ty
             at /tmp/rust-clippy/clippy_lints/src/random_state.rs:21
  22: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_ty
  23: rustc::hir::intravisit::walk_item
  24: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  25: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  26: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_decl
  27: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_stmt
  28: rustc::hir::intravisit::walk_block
  29: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_block
  30: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  31: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
  32: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_body
  33: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_nested_body
  34: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_fn
  35: rustc::hir::intravisit::walk_item
  36: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  37: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  38: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_decl
  39: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_stmt
  40: rustc::hir::intravisit::walk_block
  41: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_block
  42: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  43: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
  44: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_body
  45: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_nested_body
  46: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_fn
  47: rustc::hir::intravisit::walk_impl_item
  48: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  49: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_impl_item
  50: rustc::hir::intravisit::walk_impl_item_ref
  51: rustc::hir::intravisit::walk_item
  52: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  53: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  54: rustc::hir::intravisit::walk_mod
  55: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  56: rustc::hir::intravisit::walk_item
  57: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  58: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  59: rustc::hir::intravisit::walk_mod
  60: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  61: rustc::hir::intravisit::walk_crate
  62: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::lint::context::LintContext<'tcx>>::with_lint_attrs
  63: rustc::lint::context::check_crate
  64: rustc::util::common::time
  65: rustc_rayon_core::tlv::with
  66: <std::thread::local::LocalKey<T>>::with
  67: rustc::ty::context::tls::enter_global
  68: rustc::ty::context::TyCtxt::create_and_enter
  69: rustc_driver::driver::phase_3_run_analysis_passes
  70: rustc_driver::driver::compile_input
  71: rustc_driver::run_compiler_with_pool
  72: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  73: std::panicking::try::do_call
  74: __rust_maybe_catch_panic
  75: std::panicking::try
  76: std::panic::catch_unwind
  77: rustc_rayon_core::unwind::halt_unwinding
  78: <rustc_rayon_core::job::StackJob<L, F, R> as rustc_rayon_core::job::Job>::execute
  79: rustc_rayon_core::registry::WorkerThread::wait_until_cold
  80: rustc_rayon_core::registry::main_loop::{{closure}}
  81: <scoped_tls::ScopedKey<T>>::set
  82: <std::thread::local::LocalKey<T>>::with
  83: <scoped_tls::ScopedKey<T>>::set
  84: rustc_rayon_core::thread_pool::ThreadPool::scoped_pool::{{closure}}
  85: __rust_maybe_catch_panic
query stack during panic:
end of query stack
error: aborting due to previous error


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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.33.0-dev (664c7797f 2019-01-09) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `thread_local`.

To learn more, run the command again with --verbose.

error: internal compiler error: src/librustc/ty/context.rs:246: node type $crate::lazy::Lazy<Mutex<ThreadIdManager>> (id=2800) with HirId::owner DefId(0/0:134 ~ thread_local[ca19]::thread_id[0]::{{impl}}[3]::deref[0]::__stability[0]::LAZY[0]) cannot be placed in TypeckTables with local_id_root DefId(0/0:131 ~ thread_local[ca19]::thread_id[0]::{{impl}}[3]::deref[0]::__stability[0])
Here is output with RUST_LOG=info.

Xanewok added a commit to Xanewok/rust that referenced this issue Sep 8, 2019
Performance shouldn't be impacted (see [1] for a perf run) and this
should allow us to catch more bugs, e.g. [2] and [3].

[1]: rust-lang#64262
[2]: rust-lang#64250
[3]: rust-lang#57298
Xanewok added a commit to Xanewok/rust that referenced this issue Sep 13, 2019
Performance shouldn't be impacted (see [1] for a perf run) and this
should allow us to catch more bugs, e.g. [2] and [3].

[1]: rust-lang#64262
[2]: rust-lang#64250
[3]: rust-lang#57298
@jonas-schievink
Copy link
Contributor

This should be fixed by #64250

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants