Skip to content

TyLayout::field_type ICE on 1.34.0-nightly 865cb7010 2019-02-10 #58610

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
lukaslueg opened this issue Feb 20, 2019 · 8 comments
Closed

TyLayout::field_type ICE on 1.34.0-nightly 865cb7010 2019-02-10 #58610

lukaslueg opened this issue Feb 20, 2019 · 8 comments
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@lukaslueg
Copy link
Contributor

lukaslueg commented Feb 20, 2019

Running on cargo 1.34.0-nightly (865cb7010 2019-02-10) the travis job failed with a panic on this commit

   Compiling headless_chrome v0.1.3 (/home/travis/build/lukaslueg/rust-headless-chrome)
error: internal compiler error: src/librustc/ty/layout.rs:1656: TyLayout::field_type(TyLayout { ty: u64, details: LayoutDetails { variants: Single { index: 0 }, fields: Union(0), abi: Scalar(Scalar { value: Int(I64, false), valid_range: 0..=18446744073709551615 }), align: AbiAndPrefAlign { abi: Align { pow2: 3 }, pref: Align { pow2: 3 } }, size: Size { raw: 8 } } }): not applicable

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:620:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:70
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:200
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:215
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:482
   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_target::abi::TyLayout<'a, Ty>>::field
  15: rustc_mir::interpret::operand::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::operand_field
  16: rustc_mir::interpret::operand::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::eval_place_to_op
  17: rustc_mir::interpret::step::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::run
  18: rustc_mir::const_eval::eval_body_using_ecx
  19: rustc_mir::const_eval::const_eval_raw_provider
  20: rustc::ty::query::__query_compute::const_eval_raw
  21: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::const_eval_raw<'tcx>>::compute
  22: rustc::dep_graph::graph::DepGraph::with_task_impl
  23: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  24: rustc_mir::const_eval::const_eval_provider
  25: rustc::ty::query::__query_compute::const_eval
  26: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::const_eval<'tcx>>::compute
  27: rustc::dep_graph::graph::DepGraph::with_task_impl
  28: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  29: rustc_mir::const_eval::const_eval_provider
  30: rustc::ty::query::__query_compute::const_eval
  31: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::const_eval<'tcx>>::compute
  32: rustc::dep_graph::graph::DepGraph::with_task_impl
  33: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  34: rustc_mir::monomorphize::collector::collect_items_rec
  35: rustc_mir::monomorphize::collector::collect_items_rec
  36: rustc_mir::monomorphize::collector::collect_items_rec
  37: rustc_mir::monomorphize::collector::collect_items_rec
  38: rustc_mir::monomorphize::collector::collect_items_rec
  39: rustc_mir::monomorphize::collector::collect_items_rec
  40: rustc_mir::monomorphize::collector::collect_crate_mono_items::{{closure}}
  41: rustc::util::common::time
  42: rustc_mir::monomorphize::collector::collect_crate_mono_items
  43: rustc::util::common::time
  44: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  45: rustc::ty::query::__query_compute::collect_and_partition_mono_items
  46: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::collect_and_partition_mono_items<'tcx>>::compute
  47: rustc::dep_graph::graph::DepGraph::with_task_impl
  48: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  49: rustc_codegen_ssa::base::codegen_crate
  50: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
  51: rustc::util::common::time
  52: rustc_driver::driver::phase_4_codegen
  53: rustc_driver::driver::compile_input::{{closure}}
  54: <std::thread::local::LocalKey<T>>::with
  55: rustc::ty::context::TyCtxt::create_and_enter
  56: rustc_driver::driver::compile_input
  57: rustc_driver::run_compiler_with_pool
  58: <scoped_tls::ScopedKey<T>>::set
  59: rustc_driver::run_compiler
  60: syntax::with_globals
  61: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:87
  62: <F as alloc::boxed::FnBox<A>>::call_box
  63: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/146aa60f3484d8267e085e80611969f387eca068/src/liballoc/boxed.rs:749
             at src/libstd/sys_common/thread.rs:14
             at src/libstd/sys/unix/thread.rs:81
  64: start_thread
  65: clone
query stack during panic:
#0 [const_eval_raw] const-evaluating `browser::waiting_helpers::wait_for_mut`
#1 [const_eval] const-evaluating + checking `browser::waiting_helpers::wait_for_mut`
#2 [const_eval] const-evaluating + checking `browser::waiting_helpers::wait_for_mut`
#3 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: aborting due to previous error
@jonas-schievink jonas-schievink 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 Feb 20, 2019
@jonas-schievink
Copy link
Contributor

Works on stable and beta

@jonas-schievink jonas-schievink added I-nominated regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Feb 20, 2019
@pnkfelix
Copy link
Member

triage: P-high.

@pnkfelix pnkfelix added the P-high High priority label Feb 21, 2019
@pnkfelix pnkfelix changed the title ICE on 1.34.0-nightly 865cb7010 2019-02-10 TyLayout::field_type ICE on 1.34.0-nightly 865cb7010 2019-02-10 Feb 28, 2019
@pnkfelix
Copy link
Member

It would be good to factor out a standalone test here. All I can currently tell is that this bug was exposed by lukaslueg/rust-headless-chrome@4fc1f84

@pnkfelix
Copy link
Member

triage: assigning to @csmoe for initial investigation (e.g. factoring out standalone test)

@pnkfelix
Copy link
Member

removing nomination label since this is now prioritized and assigned

@csmoe
Copy link
Member

csmoe commented Mar 1, 2019

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=3f58bd9663c15617b067645feace6fa7

use std::time::Duration;
struct A {
    b: u64,
}

fn main() {
    let a = A { b: 1 };
    bar(|| {}, a);
}

fn bar<F>(predicate: F, a: A)
where
    F: FnMut(),
{
    if Duration::new(0, 0) == Duration::from_millis(a.b) {}
}

@oli-obk
Copy link
Contributor

oli-obk commented Mar 5, 2019

I'm guessing this is another case of the promotion bug that will be fixed by #58784

@oli-obk oli-obk added the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Mar 5, 2019
@lukaslueg
Copy link
Contributor Author

It seems this was indeed fixed by #58784

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. 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