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

ICE with clippy and hyper #49643

Closed
plumenator opened this issue Apr 4, 2018 · 4 comments
Closed

ICE with clippy and hyper #49643

plumenator opened this issue Apr 4, 2018 · 4 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@plumenator
Copy link

Internal compiler error while compiling hyper

$ RUST_BACKTRACE=1 cargo +nightly clippy
   Compiling hyper v0.9.18
error: internal compiler error: librustc/ty/context.rs:502: node_id_to_type: no type for node `expr 10 (id=631)`

thread 'rustc' panicked at 'Box<Any>', librustc_errors/lib.rs:543: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: core::ops::function::Fn::call
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::session::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: <std::thread::local::LocalKey<T>>::try_with
  11: <std::thread::local::LocalKey<T>>::with
  12: rustc::ty::context::tls::with
  13: rustc::ty::context::tls::with_opt
  14: rustc::session::opt_span_bug_fmt
  15: rustc::session::bug_fmt
  16: rustc::ty::context::TypeckTables::expr_ty
  17: clippy_lints::consts::ConstEvalLateContext::expr
  18: clippy_lints::consts::constant_simple
  19: clippy_lints::utils::hir_utils::SpanlessHash::hash_expr
  20: clippy_lints::utils::hir_utils::SpanlessHash::hash_expr
  21: clippy_lints::utils::hir_utils::SpanlessHash::hash_expr
  22: <clippy_lints::copies::CopyAndPaste as rustc::lint::LateLintPass<'a, 'tcx>>::check_expr
  23: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
  24: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_block
  25: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
  26: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_body
  27: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_nested_body
  28: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_fn
  29: rustc::hir::intravisit::walk_impl_item
  30: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_impl_item
  31: rustc::hir::intravisit::walk_impl_item_ref
  32: rustc::hir::intravisit::walk_item
  33: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  34: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  35: rustc::hir::intravisit::walk_item
  36: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  37: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  38: rustc::hir::intravisit::walk_item
  39: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  40: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  41: rustc::hir::intravisit::walk_crate
  42: rustc::lint::context::check_crate
  43: <std::thread::local::LocalKey<T>>::with
  44: <std::thread::local::LocalKey<T>>::with
  45: rustc::ty::context::TyCtxt::create_and_enter
  46: rustc_driver::driver::compile_input
  47: rustc_driver::run_compiler_impl
  48: syntax::with_globals
  49: rustc_driver::run_compiler
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.27.0-nightly (637ac17c5 2018-04-03) running on x86_64-apple-darwin

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

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

error: Could not compile `hyper`.

To learn more, run the command again with --verbose.
$
@pietroalbini pietroalbini added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Apr 5, 2018
@oherrala
Copy link

oherrala commented Apr 5, 2018

Since was closed #49644, I'll copy the minimal crate to reproduce the issue from there:

Cargo.toml:

[package]
name = "rustc-49644"
version = "0.1.0"
authors = ["Ossi Herrala <oherrala@iki.fi>"]

[dependencies]
iron = "0.6.0"

src/main.rs:

extern crate iron;
use iron::prelude::*;
use iron::status;
fn main() {
   Iron::new(|_: &mut Request| {
       Ok(Response::with((status::Ok, "Hello world!")))
   }).http("localhost:3000").unwrap();
}

@mati865
Copy link
Contributor

mati865 commented Apr 13, 2018

According to @oli-obk it's most likely caused by clippy bug.

I think rust-lang/rust-clippy#2594 is the correct place to track it.

@oherrala
Copy link

This seems to be fixed now. Fix in Clippy PR rust-lang/rust-clippy#2763

Works for me with:

I think this can be closed.

@oli-obk
Copy link
Contributor

oli-obk commented May 18, 2018

🎉

@oli-obk oli-obk closed this as completed May 18, 2018
phansch added a commit to phansch/rust-clippy that referenced this issue May 18, 2018
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-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants