Skip to content

ICE: Unknown layout #48010

Closed
Closed
@panicbit

Description

@panicbit

Affected Rust versions:
rustc 1.23.0 (766bd11 2018-01-01)
rustc 1.25.0-nightly (3d292b7 2018-02-03)

Minimal example.
(Doesn't seem to trigger on the playground for some reason.)
Doesn't trigger when being compiled as binary crate.
Playground version.

error: internal compiler error: librustc_trans/context.rs:471: failed to get layout for `&Path<Foo>`: the type `<Foo as Bar>::Slice` has an unknown layout

thread 'rustc' panicked at 'Box<Any>', librustc_errors/lib.rs:535: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
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:380
   3: std::panicking::default_hook
             at libstd/panicking.rs:396
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:576
   5: std::panicking::begin_panic
   6: rustc_errors::Handler::bug
   7: <std::thread::local::LocalKey<T>>::with
   8: rustc::ty::context::tls::with_opt
   9: rustc::session::opt_span_bug_fmt
  10: rustc::session::bug_fmt
  11: <&'a rustc_trans::context::CodegenCx<'a, 'tcx> as rustc::ty::layout::LayoutOf<&'tcx rustc::ty::TyS<'tcx>>>::layout_of
  12: rustc_trans::abi::FnType::unadjusted::{{closure}}
  13: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
  14: rustc_trans::abi::FnType::unadjusted
  15: rustc_trans::declare::declare_fn
  16: rustc_trans::trans_item::predefine_fn
  17: rustc_trans::trans_item::MonoItemExt::predefine
  18: rustc_trans::base::compile_codegen_unit
  19: rustc::ty::maps::<impl rustc::ty::maps::queries::compile_codegen_unit<'tcx>>::compute_result
  20: rustc::dep_graph::graph::DepGraph::with_task_impl
  21: rustc_errors::Handler::track_diagnostics
  22: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  23: rustc::ty::maps::<impl rustc::ty::maps::queries::compile_codegen_unit<'tcx>>::force
  24: rustc::ty::maps::<impl rustc::ty::maps::queries::compile_codegen_unit<'tcx>>::try_get
  25: rustc::ty::maps::TyCtxtAt::compile_codegen_unit
  26: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::compile_codegen_unit
  27: rustc_trans::base::trans_crate
  28: <rustc_trans::LlvmTransCrate as rustc_trans_utils::trans_crate::TransCrate>::trans_crate
  29: rustc::util::common::time
  30: rustc_driver::driver::phase_4_translate_to_llvm
  31: rustc_driver::driver::compile_input::{{closure}}
  32: <std::thread::local::LocalKey<T>>::with
  33: <std::thread::local::LocalKey<T>>::with
  34: rustc::ty::context::TyCtxt::create_and_enter
  35: rustc_driver::driver::compile_input
  36: rustc_driver::run_compiler

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions