Stream: t-compiler/wg-polymorphization

Topic: polymorphizing shims vs transitive analysis w/ cycles


eddyb (Mar 11 2020 at 15:35, on Zulip):

is this with polymorphization turned on or not?

davidtwco (Mar 11 2020 at 15:35, on Zulip):

Ugh, viewing the logs gives me a different ICE.

davidtwco (Mar 11 2020 at 15:35, on Zulip):

On

davidtwco (Mar 11 2020 at 15:35, on Zulip):

Just in my current working directory

davidtwco (Mar 11 2020 at 15:36, on Zulip):

(without any of the fixes I did for drop shims, just what the PR has)

eddyb (Mar 11 2020 at 15:37, on Zulip):

(sorry for the topic change but it was bothering me)

eddyb (Mar 11 2020 at 15:37, on Zulip):

@davidtwco so uhh I would always try something like this on fresh master

nikomatsakis (Mar 11 2020 at 15:37, on Zulip):

davidtwco [said](https://rust-lang.zulipchat.com/#narrow/stream/216091-t-compiler.2Fwg-polymorphization/topic/polymorphizing.20shims.20vs.20transitive.20analysis.20(w.2F.20cycle.20haz.2E.2E.2E/near/190295371):

Ugh, viewing the logs gives me a different ICE.

egads I hate that so much :)

eddyb (Mar 11 2020 at 15:37, on Zulip):

oh uh the parens break links so sorry

davidtwco (Mar 11 2020 at 15:38, on Zulip):

eddyb said:

oh uh the parens break links so sorry

should file this upstream with Zulip, will make a note to

eddyb (Mar 11 2020 at 15:38, on Zulip):

eddyb said:

davidtwco so uhh I would always try something like this on fresh master

that is, to iron out the kinks without any interference

davidtwco (Mar 11 2020 at 15:42, on Zulip):

I probably should do that.

davidtwco (Mar 11 2020 at 15:43, on Zulip):

drop_in_place with substs &[u8] is what has the *mut Tcomes from.

eddyb (Mar 11 2020 at 15:44, on Zulip):

aaaaah

eddyb (Mar 11 2020 at 15:44, on Zulip):

wait what

eddyb (Mar 11 2020 at 15:44, on Zulip):

@davidtwco can you get a backtrace?

eddyb (Mar 11 2020 at 15:45, on Zulip):

@davidtwco presumably the shim building code needs to be changed not to do that :P

davidtwco (Mar 11 2020 at 15:45, on Zulip):
[DEBUG rustc_codegen_ssa::mir::analyze] non_ssa_locals: fx.instance=Instance { def: DropGlue(DefId(0:1502 ~ core[9627]::ptr[0]::drop_in_place[0]), None), substs: [&u8] }
[DEBUG rustc_codegen_ssa::mir::analyze] non_ssa_locals: fx.instance=Instance { def: DropGlue(DefId(0:1502 ~ core[9627]::ptr[0]::drop_in_place[0]), None), substs: [&u8] }
error: internal compiler error: src/librustc_codegen_llvm/context.rs:900: failed to get layout for `*mut T`: the type `T` has an unknown layout

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:875:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1053
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1428
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:204
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:224
  10: <alloc::boxed::Box<F> as core::ops::function::Fn<A>>::call
             at ./src/liballoc/boxed.rs:1031
  11: rustc_driver::report_ice
             at src/librustc_driver/lib.rs:1183
  12: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:474
  13: std::panicking::begin_panic
             at ./src/libstd/panicking.rs:397
  14: rustc_errors::HandlerInner::bug
             at src/librustc_errors/lib.rs:875
  15: rustc_errors::Handler::bug
             at src/librustc_errors/lib.rs:646
  16: rustc::util::bug::opt_span_bug_fmt::{{closure}}
             at src/librustc/util/bug.rs:36
  17: rustc::ty::context::tls::with_opt::{{closure}}
             at src/librustc/ty/context.rs:1829
  18: rustc::ty::context::tls::with_context_opt
             at src/librustc/ty/context.rs:1781
  19: rustc::ty::context::tls::with_opt
             at src/librustc/ty/context.rs:1829
  20: rustc::util::bug::opt_span_bug_fmt
             at src/librustc/util/bug.rs:32
  21: rustc::util::bug::bug_fmt
             at src/librustc/util/bug.rs:12
  22: <rustc_codegen_llvm::context::CodegenCx as rustc_target::abi::LayoutOf>::spanned_layout_of::{{closure}}
             at src/librustc_codegen_llvm/context.rs:900
  23: core::result::Result<T,E>::unwrap_or_else
             at ./src/libcore/result.rs:851
  24: <rustc_codegen_llvm::context::CodegenCx as rustc_target::abi::LayoutOf>::spanned_layout_of
             at src/librustc_codegen_llvm/context.rs:896
  25: rustc_codegen_ssa::mir::analyze::non_ssa_locals
             at ./src/librustc_codegen_ssa/mir/analyze.rs:29
  26: rustc_codegen_ssa::mir::codegen_mir
             at ./src/librustc_codegen_ssa/mir/mod.rs:196
  27: rustc_codegen_ssa::base::codegen_instance
             at ./src/librustc_codegen_ssa/base.rs:389
  28: <rustc::mir::mono::MonoItem as rustc_codegen_ssa::mono_item::MonoItemExt>::define
             at ./src/librustc_codegen_ssa/mono_item.rs:42
  29: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
             at src/librustc_codegen_llvm/base.rs:130
  30: rustc::dep_graph::graph::DepGraph::with_task_impl::{{closure}}::{{closure}}
             at ./src/librustc/dep_graph/graph.rs:286
  31: rustc::ty::context::tls::enter_context::{{closure}}
             at ./src/librustc/ty/context.rs:1720
  32: rustc::ty::context::tls::set_tlv
             at ./src/librustc/ty/context.rs:1704
  33: rustc::ty::context::tls::enter_context
             at ./src/librustc/ty/context.rs:1720
  34: rustc::dep_graph::graph::DepGraph::with_task_impl::{{closure}}
             at ./src/librustc/dep_graph/graph.rs:286
  35: rustc::ty::context::tls::with_context::{{closure}}
             at ./src/librustc/ty/context.rs:1792
  36: rustc::ty::context::tls::with_context_opt
             at ./src/librustc/ty/context.rs:1781
  37: rustc::ty::context::tls::with_context
             at ./src/librustc/ty/context.rs:1792
  38: rustc::dep_graph::graph::DepGraph::with_task_impl
             at ./src/librustc/dep_graph/graph.rs:282
  39: rustc::dep_graph::graph::DepGraph::with_task
             at ./src/librustc/dep_graph/graph.rs:209
  40: rustc_codegen_llvm::base::compile_codegen_unit
             at src/librustc_codegen_llvm/base.rs:109
  41: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::ExtraBackendMethods>::compile_codegen_unit
             at src/librustc_codegen_llvm/lib.rs:109
  42: rustc_codegen_ssa::base::codegen_crate
             at ./src/librustc_codegen_ssa/base.rs:678
  43: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
             at src/librustc_codegen_llvm/lib.rs:259
  44: rustc_interface::passes::start_codegen::{{closure}}
             at src/librustc_interface/passes.rs:964
  45: rustc_data_structures::profiling::VerboseTimingGuard::run
             at ./src/librustc_data_structures/profiling.rs:569
  46: rustc_session::utils::<impl rustc_session::session::Session>::time
             at ./src/librustc_session/utils.rs:9
  47: rustc_interface::passes::start_codegen
             at src/librustc_interface/passes.rs:963
  48: rustc_interface::queries::Queries::ongoing_codegen::{{closure}}::{{closure}}
             at src/librustc_interface/queries.rs:280
  49: rustc_interface::passes::QueryContext::enter::{{closure}}
             at src/librustc_interface/passes.rs:696
  50: rustc::ty::context::tls::enter_global::{{closure}}
             at ./src/librustc/ty/context.rs:1743
  51: rustc::ty::context::tls::enter_context::{{closure}}
             at ./src/librustc/ty/context.rs:1720
  52: rustc::ty::context::tls::set_tlv
             at ./src/librustc/ty/context.rs:1704
  53: rustc::ty::context::tls::enter_context
             at ./src/librustc/ty/context.rs:1720
  54: rustc::ty::context::tls::enter_global
             at ./src/librustc/ty/context.rs:1743
  55: rustc_interface::passes::QueryContext::enter
             at src/librustc_interface/passes.rs:696
  56: rustc_interface::queries::Queries::ongoing_codegen::{{closure}}
             at src/librustc_interface/queries.rs:274
  57: rustc_interface::queries::Query<T>::compute
             at src/librustc_interface/queries.rs:33
  58: rustc_interface::queries::Queries::ongoing_codegen
             at src/librustc_interface/queries.rs:272
  59: rustc_driver::run_compiler::{{closure}}::{{closure}}
             at src/librustc_driver/lib.rs:402
  60: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
             at ./src/librustc_interface/queries.rs:339
  61: rustc_driver::run_compiler::{{closure}}
             at src/librustc_driver/lib.rs:292
  62: rustc_interface::interface::run_compiler_in_existing_thread_pool
             at ./src/librustc_interface/interface.rs:199
  63: rustc_interface::interface::run_compiler::{{closure}}
             at ./src/librustc_interface/interface.rs:213
  64: rustc_interface::util::spawn_thread_pool::{{closure}}::{{closure}}::{{closure}}
             at ./src/librustc_interface/util.rs:155
  65: scoped_tls::ScopedKey<T>::set
             at /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
  66: rustc_interface::util::spawn_thread_pool::{{closure}}::{{closure}}
             at ./src/librustc_interface/util.rs:151
  67: scoped_tls::ScopedKey<T>::set
             at /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
  68: rustc_ast::attr::with_globals::{{closure}}
             at ./src/librustc_ast/attr/mod.rs:44
  69: scoped_tls::ScopedKey<T>::set
             at /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
  70: rustc_ast::attr::with_globals
             at ./src/librustc_ast/attr/mod.rs:44
  71: rustc_interface::util::spawn_thread_pool::{{closure}}
             at ./src/librustc_interface/util.rs:150
  72: rustc_interface::util::scoped_thread::{{closure}}
             at ./src/librustc_interface/util.rs:125
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.43.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z macro-backtrace -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=3 -C debuginfo=1 -C incremental -C link-args=-Wl,-rpath,$ORIGIN/../lib -C prefer-dynamic -C llvm-args=-import-instr-limit=10 -C debug-assertions=y --crate-type lib

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

query stack during panic:
end of query stack
error: aborting due to previous error

error: could not compile `core`.
warning: build failed, waiting for other jobs to finish...
eddyb (Mar 11 2020 at 15:46, on Zulip):

okay so it's an argument local

davidtwco (Mar 11 2020 at 15:46, on Zulip):

(I added that log statement to just before this line with a target: so I could enable that and not anything else)

eddyb (Mar 11 2020 at 15:47, on Zulip):

OOOOH https://github.com/rust-lang/rust/blob/master/src/librustc_mir/shim.rs#L175-L179

eddyb (Mar 11 2020 at 15:47, on Zulip):

@davidtwco @nikomatsakis we kind of have a DropTrivial polymorphic shim already lmao

eddyb (Mar 11 2020 at 15:47, on Zulip):

you need to special-case DropGlue { ty: Some(_) only

eddyb (Mar 11 2020 at 15:48, on Zulip):

when it's None it's the noop version

davidtwco (Mar 11 2020 at 15:49, on Zulip):

to clarify, special-case to not subst when Some(_), or the opposite?

eddyb (Mar 11 2020 at 15:49, on Zulip):

former

eddyb (Mar 11 2020 at 15:49, on Zulip):

because in the None case substitution is necessary since it's exactly as polymorphic as DefId

davidtwco (Mar 11 2020 at 15:50, on Zulip):

Ooo, now I get the ICE that I got when I had logs.

eddyb (Mar 11 2020 at 15:58, on Zulip):

@davidtwco the suspense is killing me :P

davidtwco (Mar 11 2020 at 15:59, on Zulip):
[DEBUG rustc_codegen_ssa::mir::analyze] process_place: base_ty=PlaceTy { ty: Args, variant_index: None } self.instance=Instance { def: FnPtrShim(DefId(0:2087 ~ core[9627]::ops[0]::function[0]::FnOnce[0]::call_once[0]), for<'r, 's> fn(&'r usize, &'s usize) -> cmp::Ordering {<usize as cmp::Ord>::cmp}), substs: [for<'r, 's> fn(&'r usize, &'s usize) -> cmp::Ordering {<usize as cmp::Ord>::cmp}, (&usize, &usize)] }
error: internal compiler error: src/librustc_codegen_llvm/context.rs:900: failed to get layout for `Args`: the type `Args` has an unknown layout

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:875:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1053
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1428
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:204
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:224
  10: <alloc::boxed::Box<F> as core::ops::function::Fn<A>>::call
             at ./src/liballoc/boxed.rs:1031
  11: rustc_driver::report_ice
             at src/librustc_driver/lib.rs:1183
  12: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:474
  13: std::panicking::begin_panic
             at ./src/libstd/panicking.rs:397
  14: rustc_errors::HandlerInner::bug
             at src/librustc_errors/lib.rs:875
  15: rustc_errors::Handler::bug
             at src/librustc_errors/lib.rs:646
  16: rustc::util::bug::opt_span_bug_fmt::{{closure}}
             at src/librustc/util/bug.rs:36
  17: rustc::ty::context::tls::with_opt::{{closure}}
             at src/librustc/ty/context.rs:1829
  18: rustc::ty::context::tls::with_context_opt
             at src/librustc/ty/context.rs:1781
  19: rustc::ty::context::tls::with_opt
             at src/librustc/ty/context.rs:1829
  20: rustc::util::bug::opt_span_bug_fmt
             at src/librustc/util/bug.rs:32
  21: rustc::util::bug::bug_fmt
             at src/librustc/util/bug.rs:12
  22: <rustc_codegen_llvm::context::CodegenCx as rustc_target::abi::LayoutOf>::spanned_layout_of::{{closure}}
             at src/librustc_codegen_llvm/context.rs:900
  23: core::result::Result<T,E>::unwrap_or_else
             at ./src/libcore/result.rs:851
  24: <rustc_codegen_llvm::context::CodegenCx as rustc_target::abi::LayoutOf>::spanned_layout_of
             at src/librustc_codegen_llvm/context.rs:896
  25: rustc_codegen_ssa::mir::analyze::LocalAnalyzer<Bx>::process_place
             at ./src/librustc_codegen_ssa/mir/analyze.rs:134
  26: <rustc_codegen_ssa::mir::analyze::LocalAnalyzer<Bx> as rustc::mir::visit::Visitor>::visit_place
             at ./src/librustc_codegen_ssa/mir/analyze.rs:266
  27: rustc::mir::visit::Visitor::super_operand
             at ./src/librustc/mir/visit.rs:677
  28: rustc::mir::visit::Visitor::visit_operand
             at ./src/librustc/mir/visit.rs:141
  29: rustc::mir::visit::Visitor::super_terminator_kind
             at ./src/librustc/mir/visit.rs:494
  30: <rustc_codegen_ssa::mir::analyze::LocalAnalyzer<Bx> as rustc::mir::visit::Visitor>::visit_terminator_kind
             at ./src/librustc_codegen_ssa/mir/analyze.rs:261
  31: rustc::mir::visit::Visitor::super_terminator
             at ./src/librustc/mir/visit.rs:432
  32: rustc::mir::visit::Visitor::visit_terminator
             at ./src/librustc/mir/visit.rs:117
  33: rustc::mir::visit::Visitor::super_basic_block_data
             at ./src/librustc/mir/visit.rs:328
  34: rustc::mir::visit::Visitor::visit_basic_block_data
             at ./src/librustc/mir/visit.rs:93
  35: rustc::mir::visit::Visitor::super_body
             at ./src/librustc/mir/visit.rs:275
  36: rustc::mir::visit::Visitor::visit_body
             at ./src/librustc/mir/visit.rs:87
  37: rustc_codegen_ssa::mir::analyze::non_ssa_locals
             at ./src/librustc_codegen_ssa/mir/analyze.rs:23
  38: rustc_codegen_ssa::mir::codegen_mir
             at ./src/librustc_codegen_ssa/mir/mod.rs:196
  39: rustc_codegen_ssa::base::codegen_instance
             at ./src/librustc_codegen_ssa/base.rs:389
  40: <rustc::mir::mono::MonoItem as rustc_codegen_ssa::mono_item::MonoItemExt>::define
             at ./src/librustc_codegen_ssa/mono_item.rs:42
  41: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
             at src/librustc_codegen_llvm/base.rs:130
  42: rustc::dep_graph::graph::DepGraph::with_task_impl::{{closure}}::{{closure}}
             at ./src/librustc/dep_graph/graph.rs:286
  43: rustc::ty::context::tls::enter_context::{{closure}}
             at ./src/librustc/ty/context.rs:1720
  44: rustc::ty::context::tls::set_tlv
             at ./src/librustc/ty/context.rs:1704
  45: rustc::ty::context::tls::enter_context
             at ./src/librustc/ty/context.rs:1720
  46: rustc::dep_graph::graph::DepGraph::with_task_impl::{{closure}}
             at ./src/librustc/dep_graph/graph.rs:286
  47: rustc::ty::context::tls::with_context::{{closure}}
             at ./src/librustc/ty/context.rs:1792
  48: rustc::ty::context::tls::with_context_opt
             at ./src/librustc/ty/context.rs:1781
  49: rustc::ty::context::tls::with_context
             at ./src/librustc/ty/context.rs:1792
  50: rustc::dep_graph::graph::DepGraph::with_task_impl
             at ./src/librustc/dep_graph/graph.rs:282
  51: rustc::dep_graph::graph::DepGraph::with_task
             at ./src/librustc/dep_graph/graph.rs:209
  52: rustc_codegen_llvm::base::compile_codegen_unit
             at src/librustc_codegen_llvm/base.rs:109
  53: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::ExtraBackendMethods>::compile_codegen_unit
             at src/librustc_codegen_llvm/lib.rs:109
  54: rustc_codegen_ssa::base::codegen_crate
             at ./src/librustc_codegen_ssa/base.rs:678
  55: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
             at src/librustc_codegen_llvm/lib.rs:259
  56: rustc_interface::passes::start_codegen::{{closure}}
             at src/librustc_interface/passes.rs:964
  57: rustc_data_structures::profiling::VerboseTimingGuard::run
             at ./src/librustc_data_structures/profiling.rs:569
  58: rustc_session::utils::<impl rustc_session::session::Session>::time
             at ./src/librustc_session/utils.rs:9
  59: rustc_interface::passes::start_codegen
             at src/librustc_interface/passes.rs:963
  60: rustc_interface::queries::Queries::ongoing_codegen::{{closure}}::{{closure}}
             at src/librustc_interface/queries.rs:280
  61: rustc_interface::passes::QueryContext::enter::{{closure}}
             at src/librustc_interface/passes.rs:696
  62: rustc::ty::context::tls::enter_global::{{closure}}
             at ./src/librustc/ty/context.rs:1743
  63: rustc::ty::context::tls::enter_context::{{closure}}
             at ./src/librustc/ty/context.rs:1720
  64: rustc::ty::context::tls::set_tlv
             at ./src/librustc/ty/context.rs:1704
  65: rustc::ty::context::tls::enter_context
             at ./src/librustc/ty/context.rs:1720
  66: rustc::ty::context::tls::enter_global
             at ./src/librustc/ty/context.rs:1743
  67: rustc_interface::passes::QueryContext::enter
             at src/librustc_interface/passes.rs:696
  68: rustc_interface::queries::Queries::ongoing_codegen::{{closure}}
             at src/librustc_interface/queries.rs:274
  69: rustc_interface::queries::Query<T>::compute
             at src/librustc_interface/queries.rs:33
  70: rustc_interface::queries::Queries::ongoing_codegen
             at src/librustc_interface/queries.rs:272
  71: rustc_driver::run_compiler::{{closure}}::{{closure}}
             at src/librustc_driver/lib.rs:402
  72: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
             at ./src/librustc_interface/queries.rs:339
  73: rustc_driver::run_compiler::{{closure}}
             at src/librustc_driver/lib.rs:292
  74: rustc_interface::interface::run_compiler_in_existing_thread_pool
             at ./src/librustc_interface/interface.rs:199
  75: rustc_interface::interface::run_compiler::{{closure}}
             at ./src/librustc_interface/interface.rs:213
  76: rustc_interface::util::spawn_thread_pool::{{closure}}::{{closure}}::{{closure}}
             at ./src/librustc_interface/util.rs:155
  77: scoped_tls::ScopedKey<T>::set
             at /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
  78: rustc_interface::util::spawn_thread_pool::{{closure}}::{{closure}}
             at ./src/librustc_interface/util.rs:151
  79: scoped_tls::ScopedKey<T>::set
             at /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
  80: rustc_ast::attr::with_globals::{{closure}}
             at ./src/librustc_ast/attr/mod.rs:44
  81: scoped_tls::ScopedKey<T>::set
             at /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
  82: rustc_ast::attr::with_globals
             at ./src/librustc_ast/attr/mod.rs:44
...
davidtwco (Mar 11 2020 at 15:59, on Zulip):

I was trying to work something out before stealing more of your time, but there you go.

eddyb (Mar 11 2020 at 15:59, on Zulip):

oh that's a Fn traits shim

eddyb (Mar 11 2020 at 16:00, on Zulip):

you can comment out FnPtrShim for now and leave a FIXME comment I guess?

eddyb (Mar 11 2020 at 16:01, on Zulip):

presumably Args is the pseudo-VG tuple type parameter and it's obtained from the substs

eddyb (Mar 11 2020 at 16:01, on Zulip):

wait why would FnPtrShim need to exist like that

davidtwco (Mar 11 2020 at 16:02, on Zulip):

As far as I can tell, that Ord impl is implemented by the derive.

eddyb (Mar 11 2020 at 16:02, on Zulip):

FnPtrShim should probably be like ClosureOnceShim

eddyb (Mar 11 2020 at 16:03, on Zulip):

oh right we don't have proper untupling yet ughh

eddyb (Mar 11 2020 at 16:04, on Zulip):

the problem is the shim needs to be something like this:

fn call_once(self, ...args) {
    self(...args)
}
eddyb (Mar 11 2020 at 16:05, on Zulip):

and we can do the first ... but can't do the second one (it's triggered by extern "rust-call" and we haven't fixed that mess yet)

davidtwco (Mar 11 2020 at 16:06, on Zulip):
[DEBUG rustc_codegen_ssa::mir::analyze] process_place: elem_ty=Self self.instance=Instance { def: VtableShim(DefId(2:2087 ~ core[9627]::ops[0]::function[0]::FnOnce[0]::call_once[0])), substs: [[closure@/home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/symbolize/libbacktrace.rs:464:22: 467:14 called:&mut bool, cb:&mut &mut dyn for<'r> rustc_std_workspace_core::ops::FnMut(&'r symbolize::Symbol)], (&symbolize::Symbol,)] }
error: internal compiler error: src/librustc_codegen_llvm/context.rs:900: failed to get layout for `Self`: the type `Self` has an unknown layout

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:875:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at ./src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at ./src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1053
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1428
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:204
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:224
  10: <alloc::boxed::Box<F> as core::ops::function::Fn<A>>::call
             at /home/david/projects/rust/rust0/src/liballoc/boxed.rs:1031
  11: rustc_driver::report_ice
             at src/librustc_driver/lib.rs:1183
  12: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:474
  13: std::panicking::begin_panic
             at /home/david/projects/rust/rust0/src/libstd/panicking.rs:397
  14: rustc_errors::HandlerInner::bug
             at src/librustc_errors/lib.rs:875
  15: rustc_errors::Handler::bug
             at src/librustc_errors/lib.rs:646
  16: rustc::util::bug::opt_span_bug_fmt::{{closure}}
             at src/librustc/util/bug.rs:36
  17: rustc::ty::context::tls::with_opt::{{closure}}
             at src/librustc/ty/context.rs:1829
  18: rustc::ty::context::tls::with_context_opt
             at src/librustc/ty/context.rs:1781
  19: rustc::ty::context::tls::with_opt
             at src/librustc/ty/context.rs:1829
  20: rustc::util::bug::opt_span_bug_fmt
             at src/librustc/util/bug.rs:32
  21: rustc::util::bug::bug_fmt
             at src/librustc/util/bug.rs:12
  22: <rustc_codegen_llvm::context::CodegenCx as rustc_target::abi::LayoutOf>::spanned_layout_of::{{closure}}
             at src/librustc_codegen_llvm/context.rs:900
  23: core::result::Result<T,E>::unwrap_or_else
             at /home/david/projects/rust/rust0/src/libcore/result.rs:851
  24: <rustc_codegen_llvm::context::CodegenCx as rustc_target::abi::LayoutOf>::spanned_layout_of
             at src/librustc_codegen_llvm/context.rs:896
  25: rustc_codegen_ssa::mir::analyze::LocalAnalyzer<Bx>::process_place
             at /home/david/projects/rust/rust0/src/librustc_codegen_ssa/mir/analyze.rs:129
davidtwco (Mar 11 2020 at 16:06, on Zulip):

Same thing, but vtables?

eddyb (Mar 11 2020 at 16:06, on Zulip):

is this with polymorphization on?

davidtwco (Mar 11 2020 at 16:06, on Zulip):

It is

davidtwco (Mar 11 2020 at 16:06, on Zulip):

I've not split off another directory yet.

davidtwco (Mar 11 2020 at 16:07, on Zulip):

It does have the "vtable workaround" that I added.

eddyb (Mar 11 2020 at 16:07, on Zulip):

do that first before it drives you mad :P

eddyb (Mar 11 2020 at 16:07, on Zulip):

I can't at a glance figure out what's at fault here

davidtwco (Mar 11 2020 at 16:07, on Zulip):

I suppose, but I'll need to solve these ICEs as soon as I rebase on top of the branch that does this w/out.

eddyb (Mar 11 2020 at 16:07, on Zulip):

I mean, we need to fix vtables anyway, I suppose?

eddyb (Mar 11 2020 at 16:08, on Zulip):

whatever their problem is

davidtwco (Mar 11 2020 at 16:08, on Zulip):

getting another directory up-to-date, will be a moment

eddyb (Mar 11 2020 at 16:09, on Zulip):

but also I need to leave, they're going to sanitize the office soon

eddyb (Mar 11 2020 at 16:09, on Zulip):

(I don't open Zulip on my phone because my battery dreads it but feel free to PM me on Discord)

davidtwco (Mar 11 2020 at 19:43, on Zulip):

For those following along at home, #69935

Last update: Apr 03 2020 at 18:20UTC