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

improper_ctypes ICE: ast_ty_to_ty_cache was incomplete after typeck! #28804

Closed
arcnmx opened this issue Oct 2, 2015 · 3 comments
Closed

improper_ctypes ICE: ast_ty_to_ty_cache was incomplete after typeck! #28804

arcnmx opened this issue Oct 2, 2015 · 3 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@arcnmx
Copy link
Contributor

arcnmx commented Oct 2, 2015

playpen repro

extern {
    fn f(_: &(::std::any::Any + Send));
}
fn main() { }
error: internal compiler error: unexpected panic
thread 'rustc' panicked at 'ast_ty_to_ty_cache was incomplete after typeck!', ../src/librustc_lint/types.rs:391
stack backtrace:
   1:     0x560b9f816a0b - sys::backtrace::tracing::imp::write::hba31dba16b77db51Nlt
   2:     0x560b9f81bc05 - panicking::log_panic::closure.39174
   3:     0x560b9f81b685 - panicking::log_panic::hfa717843622c0734Zlx
   4:     0x560b9f7f6d7b - sys_common::unwind::begin_unwind_inner::he7414b3062c61595eds
   5:     0x560b9db11d1f - sys_common::unwind::begin_unwind::h15594441680360665897
   6:     0x560b9db26772 - types::ast_ty_to_normalized::h5caed057635af03cGhc
   7:     0x560b9db2b591 - types::ImproperCTypesVisitor<'a, 'tcx>.Visitor<'v>::visit_ty::ha6849becfc2fcdfb2sc
   8:     0x560b9db2ba02 - types::ImproperCTypesVisitor<'a, 'tcx>.Visitor<'v>::visit_ty::ha6849becfc2fcdfb2sc
   9:     0x560b9db2d994 - types::ImproperCTypes.LateLintPass::check_item::hc5ff5ab422fa7dabLuc
  10:     0x560b9e43fe7c - lint::context::LintContext::with_lint_attrs::h4461143242089743573
  11:     0x560b9e4449de - lint::context::LateContext<'a, 'tcx>.hir_visit..Visitor<'v>::visit_mod::h082d2fd73f1d33efuBy
  12:     0x560b9e44046e - lint::context::LintContext::with_lint_attrs::h4461143242089743573
  13:     0x560b9e4449de - lint::context::LateContext<'a, 'tcx>.hir_visit..Visitor<'v>::visit_mod::h082d2fd73f1d33efuBy
  14:     0x560b9e44046e - lint::context::LintContext::with_lint_attrs::h4461143242089743573
  15:     0x560b9e4449de - lint::context::LateContext<'a, 'tcx>.hir_visit..Visitor<'v>::visit_mod::h082d2fd73f1d33efuBy
  16:     0x560b9e44046e - lint::context::LintContext::with_lint_attrs::h4461143242089743573
  17:     0x560b9e4449de - lint::context::LateContext<'a, 'tcx>.hir_visit..Visitor<'v>::visit_mod::h082d2fd73f1d33efuBy
  18:     0x560b9e45dfa1 - lint::context::check_crate::h0fdb0f40136207458sz
  19:     0x560b9d9c4f09 - driver::phase_3_run_analysis_passes::closure.21553
  20:     0x560b9d9a2e4c - middle::ty::context::ctxt<'tcx>::create_and_enter::h13487176223927967638
  21:     0x560b9d99f125 - driver::phase_3_run_analysis_passes::h11393868287546209260
  22:     0x560b9d977e37 - driver::compile_input::ha46944a2bbe53b7f0ba
  23:     0x560b9db0209b - run_compiler::h8155732b0e5e09eb2qc
  24:     0x560b9daff8ff - boxed::F.FnBox<A>::call_box::h2048703687297876069
  25:     0x560b9daff074 - sys_common::unwind::try::try_fn::h15464389101487040097
  26:     0x560b9f815eb8 - __rust_try
  27:     0x560b9f80d196 - sys_common::unwind::try::inner_try::h21b6ca34e1ad0d87M9r
  28:     0x560b9daff204 - boxed::F.FnBox<A>::call_box::h15456627145164089159
  29:     0x560b9f81a773 - sys::thread::Thread::new::thread_start::h4828a71dbdf08936bEw
  30:     0x7fba59f5b4a3 - start_thread
  31:     0x7fba5936613c - clone
  32:                0x0 - <unknown>
@jdm jdm added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Oct 2, 2015
@arielb1
Copy link
Contributor

arielb1 commented Oct 2, 2015

Why is the ctypes lint poking at HIR types by itself? Shouldn't it be looking the function type in the tcache?

@sanxiyn
Copy link
Member

sanxiyn commented Dec 30, 2015

The motivation seems that HIR types have spans, but types don't. Lint wants to pinpoint which argument's type is FFI unsafe, instead of blaming the whole function type.

@steveklabnik
Copy link
Member

This no longer ICEs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

5 participants